aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/usb-gigaset.c
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2006-04-11 01:55:07 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 09:18:49 -0400
commitb1d47464c947f08125dc4ac4a2321ced9e2fed29 (patch)
tree6a977f4335c5a2ab734779fb52565c81eb61bb1b /drivers/isdn/gigaset/usb-gigaset.c
parent784d5858aac58c06608def862d73ae9a32f5ee23 (diff)
[PATCH] isdn4linux: Siemens Gigaset drivers: sysfs usage
With Hansjoerg Lipp <hjlipp@web.de> Correct the way the Gigaset drivers create their sysfs entries. Signed-off-by: Hansjoerg Lipp <hjlipp@web.de> Signed-off-by: Tilman Schmidt <tilman@imap.cc> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/isdn/gigaset/usb-gigaset.c')
-rw-r--r--drivers/isdn/gigaset/usb-gigaset.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
index f09d821b6e89..a977dd570751 100644
--- a/drivers/isdn/gigaset/usb-gigaset.c
+++ b/drivers/isdn/gigaset/usb-gigaset.c
@@ -748,7 +748,10 @@ static int gigaset_probe(struct usb_interface *interface,
748 usb_get_dev(udev); 748 usb_get_dev(udev);
749 ucs->udev = udev; 749 ucs->udev = udev;
750 ucs->interface = interface; 750 ucs->interface = interface;
751 cs->dev = &udev->dev; 751 cs->dev = &interface->dev;
752
753 /* save address of controller structure */
754 usb_set_intfdata(interface, cs); // dev_set_drvdata(&interface->dev, cs);
752 755
753 endpoint = &hostif->endpoint[0].desc; 756 endpoint = &hostif->endpoint[0].desc;
754 757
@@ -805,17 +808,12 @@ static int gigaset_probe(struct usb_interface *interface,
805 /* tell common part that the device is ready */ 808 /* tell common part that the device is ready */
806 if (startmode == SM_LOCKED) 809 if (startmode == SM_LOCKED)
807 atomic_set(&cs->mstate, MS_LOCKED); 810 atomic_set(&cs->mstate, MS_LOCKED);
811
808 if (!gigaset_start(cs)) { 812 if (!gigaset_start(cs)) {
809 tasklet_kill(&cs->write_tasklet); 813 tasklet_kill(&cs->write_tasklet);
810 retval = -ENODEV; //FIXME 814 retval = -ENODEV; //FIXME
811 goto error; 815 goto error;
812 } 816 }
813
814 /* save address of controller structure */
815 usb_set_intfdata(interface, cs);
816
817 /* set up device sysfs */
818 gigaset_init_dev_sysfs(interface);
819 return 0; 817 return 0;
820 818
821error: 819error:
@@ -827,6 +825,7 @@ error:
827 kfree(cs->inbuf[0].rcvbuf); 825 kfree(cs->inbuf[0].rcvbuf);
828 if (ucs->read_urb != NULL) 826 if (ucs->read_urb != NULL)
829 usb_free_urb(ucs->read_urb); 827 usb_free_urb(ucs->read_urb);
828 usb_set_intfdata(interface, NULL);
830 ucs->read_urb = ucs->bulk_out_urb = NULL; 829 ucs->read_urb = ucs->bulk_out_urb = NULL;
831 cs->inbuf[0].rcvbuf = ucs->bulk_out_buffer = NULL; 830 cs->inbuf[0].rcvbuf = ucs->bulk_out_buffer = NULL;
832 usb_put_dev(ucs->udev); 831 usb_put_dev(ucs->udev);
@@ -845,16 +844,12 @@ static void gigaset_disconnect(struct usb_interface *interface)
845 struct usb_cardstate *ucs; 844 struct usb_cardstate *ucs;
846 845
847 cs = usb_get_intfdata(interface); 846 cs = usb_get_intfdata(interface);
848
849 /* clear device sysfs */
850 gigaset_free_dev_sysfs(interface);
851
852 usb_set_intfdata(interface, NULL);
853 ucs = cs->hw.usb; 847 ucs = cs->hw.usb;
854 usb_kill_urb(ucs->read_urb); 848 usb_kill_urb(ucs->read_urb);
855 849
856 gigaset_stop(cs); 850 gigaset_stop(cs);
857 851
852 usb_set_intfdata(interface, NULL);
858 tasklet_kill(&cs->write_tasklet); 853 tasklet_kill(&cs->write_tasklet);
859 854
860 usb_kill_urb(ucs->bulk_out_urb); /* FIXME: only if active? */ 855 usb_kill_urb(ucs->bulk_out_urb); /* FIXME: only if active? */
@@ -868,6 +863,10 @@ static void gigaset_disconnect(struct usb_interface *interface)
868 ucs->read_urb = ucs->bulk_out_urb = NULL; 863 ucs->read_urb = ucs->bulk_out_urb = NULL;
869 cs->inbuf[0].rcvbuf = ucs->bulk_out_buffer = NULL; 864 cs->inbuf[0].rcvbuf = ucs->bulk_out_buffer = NULL;
870 865
866 usb_put_dev(ucs->udev);
867 ucs->interface = NULL;
868 ucs->udev = NULL;
869 cs->dev = NULL;
871 gigaset_unassign(cs); 870 gigaset_unassign(cs);
872} 871}
873 872