[POWERPC] Remove find_compatible_devices
This is an old interface and is replaced by of_find_compatible_node. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Родитель
6210230725
Коммит
4bf56e1725
|
@ -1170,30 +1170,6 @@ int machine_is_compatible(const char *compat)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(machine_is_compatible);
|
EXPORT_SYMBOL(machine_is_compatible);
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct and return a list of the device_nodes with a given type
|
|
||||||
* and compatible property.
|
|
||||||
*/
|
|
||||||
struct device_node *find_compatible_devices(const char *type,
|
|
||||||
const char *compat)
|
|
||||||
{
|
|
||||||
struct device_node *head, **prevp, *np;
|
|
||||||
|
|
||||||
prevp = &head;
|
|
||||||
for (np = allnodes; np != 0; np = np->allnext) {
|
|
||||||
if (type != NULL
|
|
||||||
&& !(np->type != 0 && strcasecmp(np->type, type) == 0))
|
|
||||||
continue;
|
|
||||||
if (of_device_is_compatible(np, compat)) {
|
|
||||||
*prevp = np;
|
|
||||||
prevp = &np->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*prevp = NULL;
|
|
||||||
return head;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(find_compatible_devices);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the device_node with a given full_name.
|
* Find the device_node with a given full_name.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -39,12 +39,17 @@ long __init chrp_time_init(void)
|
||||||
struct resource r;
|
struct resource r;
|
||||||
int base;
|
int base;
|
||||||
|
|
||||||
rtcs = find_compatible_devices("rtc", "pnpPNP,b00");
|
rtcs = of_find_compatible_node(NULL, "rtc", "pnpPNP,b00");
|
||||||
|
if (rtcs == NULL)
|
||||||
|
rtcs = of_find_compatible_node(NULL, "rtc", "ds1385-rtc");
|
||||||
if (rtcs == NULL)
|
if (rtcs == NULL)
|
||||||
rtcs = find_compatible_devices("rtc", "ds1385-rtc");
|
|
||||||
if (rtcs == NULL || of_address_to_resource(rtcs, 0, &r))
|
|
||||||
return 0;
|
return 0;
|
||||||
|
if (of_address_to_resource(rtcs, 0, &r)) {
|
||||||
|
of_node_put(rtcs);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
of_node_put(rtcs);
|
||||||
|
|
||||||
base = r.start;
|
base = r.start;
|
||||||
nvram_as1 = 0;
|
nvram_as1 = 0;
|
||||||
nvram_as0 = base;
|
nvram_as0 = base;
|
||||||
|
|
|
@ -82,7 +82,14 @@ struct adb_driver macio_adb_driver = {
|
||||||
|
|
||||||
int macio_probe(void)
|
int macio_probe(void)
|
||||||
{
|
{
|
||||||
return find_compatible_devices("adb", "chrp,adb0")? 0: -ENODEV;
|
struct device_node *np;
|
||||||
|
|
||||||
|
np = of_find_compatible_node(NULL, "adb", "chrp,adb0");
|
||||||
|
if (np) {
|
||||||
|
of_node_put(np);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
int macio_init(void)
|
int macio_init(void)
|
||||||
|
@ -91,12 +98,14 @@ int macio_init(void)
|
||||||
struct resource r;
|
struct resource r;
|
||||||
unsigned int irq;
|
unsigned int irq;
|
||||||
|
|
||||||
adbs = find_compatible_devices("adb", "chrp,adb0");
|
adbs = of_find_compatible_node(NULL, "adb", "chrp,adb0");
|
||||||
if (adbs == 0)
|
if (adbs == 0)
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
|
||||||
if (of_address_to_resource(adbs, 0, &r))
|
if (of_address_to_resource(adbs, 0, &r)) {
|
||||||
|
of_node_put(adbs);
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
}
|
||||||
adb = ioremap(r.start, sizeof(struct adb_regs));
|
adb = ioremap(r.start, sizeof(struct adb_regs));
|
||||||
|
|
||||||
out_8(&adb->ctrl.r, 0);
|
out_8(&adb->ctrl.r, 0);
|
||||||
|
@ -107,6 +116,7 @@ int macio_init(void)
|
||||||
out_8(&adb->autopoll.r, APE);
|
out_8(&adb->autopoll.r, APE);
|
||||||
|
|
||||||
irq = irq_of_parse_and_map(adbs, 0);
|
irq = irq_of_parse_and_map(adbs, 0);
|
||||||
|
of_node_put(adbs);
|
||||||
if (request_irq(irq, macio_adb_interrupt, 0, "ADB", (void *)0)) {
|
if (request_irq(irq, macio_adb_interrupt, 0, "ADB", (void *)0)) {
|
||||||
printk(KERN_ERR "ADB: can't get irq %d\n", irq);
|
printk(KERN_ERR "ADB: can't get irq %d\n", irq);
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
|
|
|
@ -116,8 +116,6 @@ static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_e
|
||||||
extern struct device_node *find_devices(const char *name);
|
extern struct device_node *find_devices(const char *name);
|
||||||
extern struct device_node *find_type_devices(const char *type);
|
extern struct device_node *find_type_devices(const char *type);
|
||||||
extern struct device_node *find_path_device(const char *path);
|
extern struct device_node *find_path_device(const char *path);
|
||||||
extern struct device_node *find_compatible_devices(const char *type,
|
|
||||||
const char *compat);
|
|
||||||
extern struct device_node *find_all_nodes(void);
|
extern struct device_node *find_all_nodes(void);
|
||||||
|
|
||||||
/* New style node lookup */
|
/* New style node lookup */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче