|
@@ -173,6 +173,7 @@ static int __init dio_init(void)
|
|
mm_segment_t fs;
|
|
mm_segment_t fs;
|
|
int i;
|
|
int i;
|
|
struct dio_dev *dev;
|
|
struct dio_dev *dev;
|
|
|
|
+ int error;
|
|
|
|
|
|
if (!MACH_IS_HP300)
|
|
if (!MACH_IS_HP300)
|
|
return 0;
|
|
return 0;
|
|
@@ -182,7 +183,11 @@ static int __init dio_init(void)
|
|
/* Initialize the DIO bus */
|
|
/* Initialize the DIO bus */
|
|
INIT_LIST_HEAD(&dio_bus.devices);
|
|
INIT_LIST_HEAD(&dio_bus.devices);
|
|
strcpy(dio_bus.dev.bus_id, "dio");
|
|
strcpy(dio_bus.dev.bus_id, "dio");
|
|
- device_register(&dio_bus.dev);
|
|
|
|
|
|
+ error = device_register(&dio_bus.dev);
|
|
|
|
+ if (error) {
|
|
|
|
+ pr_err("DIO: Error registering dio_bus\n");
|
|
|
|
+ return error;
|
|
|
|
+ }
|
|
|
|
|
|
/* Request all resources */
|
|
/* Request all resources */
|
|
dio_bus.num_resources = (hp300_model == HP_320 ? 1 : 2);
|
|
dio_bus.num_resources = (hp300_model == HP_320 ? 1 : 2);
|
|
@@ -252,8 +257,15 @@ static int __init dio_init(void)
|
|
|
|
|
|
if (scode >= DIOII_SCBASE)
|
|
if (scode >= DIOII_SCBASE)
|
|
iounmap(va);
|
|
iounmap(va);
|
|
- device_register(&dev->dev);
|
|
|
|
- dio_create_sysfs_dev_files(dev);
|
|
|
|
|
|
+ error = device_register(&dev->dev);
|
|
|
|
+ if (error) {
|
|
|
|
+ pr_err("DIO: Error registering device %s\n",
|
|
|
|
+ dev->name);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ error = dio_create_sysfs_dev_files(dev);
|
|
|
|
+ if (error)
|
|
|
|
+ dev_err(&dev->dev, "Error creating sysfs files\n");
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|