X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/41a1b398bf97d389f4542666b8498f4c45121060..c3adf4f9af7ee68df8bb65fafa4dbcbdcc4895ba:/lincan/src/usbcan.c diff --git a/lincan/src/usbcan.c b/lincan/src/usbcan.c index 4492f61..a5e938a 100644 --- a/lincan/src/usbcan.c +++ b/lincan/src/usbcan.c @@ -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 */