]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/usbcan.c
Change of parameter order in hotplug functions, more debug messages
[lincan.git] / lincan / src / usbcan.c
index 4492f616d1e030c3ee238ba7c1391416a2ab9f85..a5e938a441993d83683b6e04acc3af6a2d884d07 100644 (file)
@@ -573,19 +573,20 @@ int usbcan_stop_chip(struct canchip_t *chip)
  *
  * File: src/usbcan.c
  */
-void usbcan_register_devs(struct canchip_t *chip,void *data){
+int usbcan_register_devs(struct canchip_t *chip,void *data){
        struct usbcan_devs *usbdevs=(struct usbcan_devs *)data;
        if (!usbdevs){
            CANMSG("Bad structure given\n");
-           return;
+           return -1;
        }
        if (chip->chip_idx>=usbdevs->count) {
            CANMSG("Requested chip number is bigger than chip count\n");
-           return;
+           return -1;
        }
 
        usbdevs->devs[chip->chip_idx]->chip=chip;
        chip->chip_data=(void *)usbdevs->devs[chip->chip_idx];
+       return 0;
 }
 
 /**
@@ -1459,7 +1460,7 @@ static int usbcan_probe(struct usb_interface *interface, const struct usb_device
        /* save our data pointer in this interface device */
        usb_set_intfdata(interface, usbdevs);
 
-       if (!(usbdevs->candev=register_hotplug_dev("usbcan",(void *) usbdevs, usbcan_register_devs)))
+       if (!(usbdevs->candev=register_hotplug_dev("usbcan", usbcan_register_devs,(void *) usbdevs)))
                goto register_error;
 
        /* let the user know what node this device is now attached to */