aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm/ueagle-atm.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-08-28 14:43:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 14:58:58 -0400
commite7ccdfec087f02930c5cdc81143d4a045ae8d361 (patch)
tree99032e6dc4b6809fe90ab80021cd935fba518bd2 /drivers/usb/atm/ueagle-atm.c
parent4d42e1bb9e8ec7eb5e39d82aaf3ff2f3c994af84 (diff)
USB: fix __must_check warnings in drivers/usb/atm/
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/atm/ueagle-atm.c')
-rw-r--r--drivers/usb/atm/ueagle-atm.c74
1 files changed, 34 insertions, 40 deletions
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index b38990adf1cd..465961a26e4a 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -1621,26 +1621,32 @@ static int claim_interface(struct usb_device *usb_dev,
1621 return ret; 1621 return ret;
1622} 1622}
1623 1623
1624static void create_fs_entries(struct uea_softc *sc, struct usb_interface *intf) 1624static struct attribute *attrs[] = {
1625 &dev_attr_stat_status.attr,
1626 &dev_attr_stat_mflags.attr,
1627 &dev_attr_stat_human_status.attr,
1628 &dev_attr_stat_delin.attr,
1629 &dev_attr_stat_vidcpe.attr,
1630 &dev_attr_stat_usrate.attr,
1631 &dev_attr_stat_dsrate.attr,
1632 &dev_attr_stat_usattenuation.attr,
1633 &dev_attr_stat_dsattenuation.attr,
1634 &dev_attr_stat_usmargin.attr,
1635 &dev_attr_stat_dsmargin.attr,
1636 &dev_attr_stat_txflow.attr,
1637 &dev_attr_stat_rxflow.attr,
1638 &dev_attr_stat_uscorr.attr,
1639 &dev_attr_stat_dscorr.attr,
1640 &dev_attr_stat_usunc.attr,
1641 &dev_attr_stat_dsunc.attr,
1642};
1643static struct attribute_group attr_grp = {
1644 .attrs = attrs,
1645};
1646
1647static int create_fs_entries(struct usb_interface *intf)
1625{ 1648{
1626 /* sysfs interface */ 1649 return sysfs_create_group(&intf->dev.kobj, &attr_grp);
1627 device_create_file(&intf->dev, &dev_attr_stat_status);
1628 device_create_file(&intf->dev, &dev_attr_stat_mflags);
1629 device_create_file(&intf->dev, &dev_attr_stat_human_status);
1630 device_create_file(&intf->dev, &dev_attr_stat_delin);
1631 device_create_file(&intf->dev, &dev_attr_stat_vidcpe);
1632 device_create_file(&intf->dev, &dev_attr_stat_usrate);
1633 device_create_file(&intf->dev, &dev_attr_stat_dsrate);
1634 device_create_file(&intf->dev, &dev_attr_stat_usattenuation);
1635 device_create_file(&intf->dev, &dev_attr_stat_dsattenuation);
1636 device_create_file(&intf->dev, &dev_attr_stat_usmargin);
1637 device_create_file(&intf->dev, &dev_attr_stat_dsmargin);
1638 device_create_file(&intf->dev, &dev_attr_stat_txflow);
1639 device_create_file(&intf->dev, &dev_attr_stat_rxflow);
1640 device_create_file(&intf->dev, &dev_attr_stat_uscorr);
1641 device_create_file(&intf->dev, &dev_attr_stat_dscorr);
1642 device_create_file(&intf->dev, &dev_attr_stat_usunc);
1643 device_create_file(&intf->dev, &dev_attr_stat_dsunc);
1644} 1650}
1645 1651
1646static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf, 1652static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,
@@ -1708,37 +1714,25 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,
1708 return ret; 1714 return ret;
1709 } 1715 }
1710 1716
1711 create_fs_entries(sc, intf); 1717 ret = create_fs_entries(intf);
1718 if (ret) {
1719 uea_stop(sc);
1720 kfree(sc);
1721 return ret;
1722 }
1712 return 0; 1723 return 0;
1713} 1724}
1714 1725
1715static void destroy_fs_entries(struct uea_softc *sc, struct usb_interface *intf) 1726static void destroy_fs_entries(struct usb_interface *intf)
1716{ 1727{
1717 /* sysfs interface */ 1728 sysfs_remove_group(&intf->dev.kobj, &attr_grp);
1718 device_remove_file(&intf->dev, &dev_attr_stat_status);
1719 device_remove_file(&intf->dev, &dev_attr_stat_mflags);
1720 device_remove_file(&intf->dev, &dev_attr_stat_human_status);
1721 device_remove_file(&intf->dev, &dev_attr_stat_delin);
1722 device_remove_file(&intf->dev, &dev_attr_stat_vidcpe);
1723 device_remove_file(&intf->dev, &dev_attr_stat_usrate);
1724 device_remove_file(&intf->dev, &dev_attr_stat_dsrate);
1725 device_remove_file(&intf->dev, &dev_attr_stat_usattenuation);
1726 device_remove_file(&intf->dev, &dev_attr_stat_dsattenuation);
1727 device_remove_file(&intf->dev, &dev_attr_stat_usmargin);
1728 device_remove_file(&intf->dev, &dev_attr_stat_dsmargin);
1729 device_remove_file(&intf->dev, &dev_attr_stat_txflow);
1730 device_remove_file(&intf->dev, &dev_attr_stat_rxflow);
1731 device_remove_file(&intf->dev, &dev_attr_stat_uscorr);
1732 device_remove_file(&intf->dev, &dev_attr_stat_dscorr);
1733 device_remove_file(&intf->dev, &dev_attr_stat_usunc);
1734 device_remove_file(&intf->dev, &dev_attr_stat_dsunc);
1735} 1729}
1736 1730
1737static void uea_unbind(struct usbatm_data *usbatm, struct usb_interface *intf) 1731static void uea_unbind(struct usbatm_data *usbatm, struct usb_interface *intf)
1738{ 1732{
1739 struct uea_softc *sc = usbatm->driver_data; 1733 struct uea_softc *sc = usbatm->driver_data;
1740 1734
1741 destroy_fs_entries(sc, intf); 1735 destroy_fs_entries(intf);
1742 uea_stop(sc); 1736 uea_stop(sc);
1743 kfree(sc); 1737 kfree(sc);
1744} 1738}