Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
17445dc8
Commit
17445dc8
authored
Nov 22, 2002
by
James Bottomley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add mca-driver handling
Tidies up the handling of MCA drivers
parent
30e8f697
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
36 deletions
+16
-36
drivers/mca/Makefile
drivers/mca/Makefile
+2
-2
drivers/mca/mca-bus.c
drivers/mca/mca-bus.c
+6
-28
include/linux/mca.h
include/linux/mca.h
+8
-6
No files found.
drivers/mca/Makefile
View file @
17445dc8
# Makefile for the Linux MCA bus support
obj-y
:=
mca-bus.o mca-device.o mca-legacy.o
obj-y
:=
mca-bus.o mca-device.o mca-
driver.o mca-
legacy.o
obj-$(CONFIG_PROC_FS)
+=
mca-proc.o
export-objs
:=
mca-bus.o mca-legacy.o mca-proc.o
export-objs
:=
mca-bus.o mca-legacy.o mca-proc.o
mca-driver.o
include
$(TOPDIR)/Rules.make
drivers/mca/mca-bus.c
View file @
17445dc8
...
...
@@ -30,8 +30,6 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <asm/io.h>
/* Very few machines have more than one MCA bus. However, there are
* those that do (Voyager 35xx/5xxx), so we do it this way for future
...
...
@@ -50,15 +48,16 @@ static int mca_bus_match (struct device *dev, struct device_driver *drv)
struct
mca_device
*
mca_dev
=
to_mca_device
(
dev
);
struct
mca_driver
*
mca_drv
=
to_mca_driver
(
drv
);
const
short
*
mca_ids
=
mca_drv
->
id_table
;
int
i
;
if
(
!
mca_ids
)
return
0
;
while
(
*
mca_ids
)
{
if
(
*
mca_ids
==
mca_dev
->
pos_id
)
for
(
i
=
0
;
mca_ids
[
i
];
i
++
)
{
if
(
mca_ids
[
i
]
==
mca_dev
->
pos_id
)
{
mca_dev
->
index
=
i
;
return
1
;
mca_ids
++
;
}
}
return
0
;
...
...
@@ -70,24 +69,6 @@ struct bus_type mca_bus_type = {
};
EXPORT_SYMBOL
(
mca_bus_type
);
int
mca_driver_register
(
struct
mca_driver
*
mca_drv
)
{
int
r
;
mca_drv
->
driver
.
bus
=
&
mca_bus_type
;
if
((
r
=
driver_register
(
&
mca_drv
->
driver
))
<
0
)
return
r
;
return
1
;
}
void
mca_driver_unregister
(
struct
mca_driver
*
mca_drv
)
{
bus_remove_driver
(
&
mca_drv
->
driver
);
driver_unregister
(
&
mca_drv
->
driver
);
}
static
ssize_t
mca_show_pos_id
(
struct
device
*
dev
,
char
*
buf
,
size_t
count
,
loff_t
off
)
{
...
...
@@ -135,7 +116,7 @@ static ssize_t mca_show_pos(struct device *dev, char *buf, size_t count,
static
DEVICE_ATTR
(
id
,
S_IRUGO
,
mca_show_pos_id
,
NULL
);
static
DEVICE_ATTR
(
pos
,
S_IRUGO
,
mca_show_pos
,
NULL
);
int
__init
mca_register_device
(
int
bus
,
struct
mca_device
*
mca_dev
)
int
__init
mca_register_device
(
int
bus
,
struct
mca_device
*
mca_dev
)
{
struct
mca_bus
*
mca_bus
=
mca_root_busses
[
bus
];
...
...
@@ -184,6 +165,3 @@ int __init mca_system_init (void)
{
return
bus_register
(
&
mca_bus_type
);
}
EXPORT_SYMBOL
(
mca_driver_register
);
EXPORT_SYMBOL
(
mca_driver_unregister
);
include/linux/mca.h
View file @
17445dc8
...
...
@@ -52,6 +52,9 @@ struct mca_device {
int
pos_id
;
int
slot
;
/* index into id_table, set by the bus match routine */
int
index
;
/* is there a driver installed? 0 - No, 1 - Yes */
int
driver_loaded
;
/* POS registers */
...
...
@@ -100,8 +103,6 @@ struct mca_driver {
#define to_mca_driver(mdriver) container_of(mdriver, struct mca_driver, driver)
/* Ongoing supported API functions */
extern
int
mca_driver_register
(
struct
mca_driver
*
);
extern
int
mca_register_device
(
int
bus
,
struct
mca_device
*
);
extern
struct
mca_device
*
mca_find_device_by_slot
(
int
slot
);
extern
int
mca_system_init
(
void
);
extern
struct
mca_bus
*
mca_attach_bus
(
int
);
...
...
@@ -121,10 +122,11 @@ extern enum MCA_AdapterStatus mca_device_status(struct mca_device *mca_dev);
extern
struct
bus_type
mca_bus_type
;
static
inline
void
mca_register_driver
(
struct
mca_driver
*
drv
)
{
driver_register
(
&
drv
->
driver
);
}
extern
int
mca_register_driver
(
struct
mca_driver
*
drv
);
extern
void
mca_unregister_driver
(
struct
mca_driver
*
drv
);
/* WARNING: only called by the boot time device setup */
extern
int
mca_register_device
(
int
bus
,
struct
mca_device
*
mca_dev
);
/* for now, include the legacy API */
#include <linux/mca-legacy.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment