diff options
author | Felipe Balbi <balbi@ti.com> | 2011-10-08 06:08:01 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-10-13 13:39:54 -0400 |
commit | 5bc639fc55b51f828b20747eb1c48a669053b1e5 (patch) | |
tree | 9a069c78e732b2cfbff7d55f55e7ab4553ae9776 /drivers | |
parent | 1a8060d9e5c0d9488f7f1aa830ed37adcaba6adb (diff) |
usb: gadget: langwell: don't use the_controller when it's not needed
in most cases, we can fetch our structure by
calling dev_get_drvdata().
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/langwell_udc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c index cb728d3079af..444bd11d3f4b 100644 --- a/drivers/usb/gadget/langwell_udc.c +++ b/drivers/usb/gadget/langwell_udc.c | |||
@@ -1551,7 +1551,7 @@ static void stop_activity(struct langwell_udc *dev, | |||
1551 | static ssize_t show_function(struct device *_dev, | 1551 | static ssize_t show_function(struct device *_dev, |
1552 | struct device_attribute *attr, char *buf) | 1552 | struct device_attribute *attr, char *buf) |
1553 | { | 1553 | { |
1554 | struct langwell_udc *dev = the_controller; | 1554 | struct langwell_udc *dev = dev_get_drvdata(_dev); |
1555 | 1555 | ||
1556 | if (!dev->driver || !dev->driver->function | 1556 | if (!dev->driver || !dev->driver->function |
1557 | || strlen(dev->driver->function) > PAGE_SIZE) | 1557 | || strlen(dev->driver->function) > PAGE_SIZE) |
@@ -1580,7 +1580,7 @@ static inline enum usb_device_speed lpm_device_speed(u32 reg) | |||
1580 | static ssize_t show_langwell_udc(struct device *_dev, | 1580 | static ssize_t show_langwell_udc(struct device *_dev, |
1581 | struct device_attribute *attr, char *buf) | 1581 | struct device_attribute *attr, char *buf) |
1582 | { | 1582 | { |
1583 | struct langwell_udc *dev = the_controller; | 1583 | struct langwell_udc *dev = dev_get_drvdata(_dev); |
1584 | struct langwell_request *req; | 1584 | struct langwell_request *req; |
1585 | struct langwell_ep *ep = NULL; | 1585 | struct langwell_ep *ep = NULL; |
1586 | char *next; | 1586 | char *next; |
@@ -1812,7 +1812,7 @@ static DEVICE_ATTR(langwell_udc, S_IRUGO, show_langwell_udc, NULL); | |||
1812 | static ssize_t store_remote_wakeup(struct device *_dev, | 1812 | static ssize_t store_remote_wakeup(struct device *_dev, |
1813 | struct device_attribute *attr, const char *buf, size_t count) | 1813 | struct device_attribute *attr, const char *buf, size_t count) |
1814 | { | 1814 | { |
1815 | struct langwell_udc *dev = the_controller; | 1815 | struct langwell_udc *dev = dev_get_drvdata(_dev); |
1816 | unsigned long flags; | 1816 | unsigned long flags; |
1817 | ssize_t rc = count; | 1817 | ssize_t rc = count; |
1818 | 1818 | ||
@@ -2973,7 +2973,7 @@ static irqreturn_t langwell_irq(int irq, void *_dev) | |||
2973 | /* release device structure */ | 2973 | /* release device structure */ |
2974 | static void gadget_release(struct device *_dev) | 2974 | static void gadget_release(struct device *_dev) |
2975 | { | 2975 | { |
2976 | struct langwell_udc *dev = the_controller; | 2976 | struct langwell_udc *dev = dev_get_drvdata(_dev); |
2977 | 2977 | ||
2978 | dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); | 2978 | dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); |
2979 | 2979 | ||
@@ -3031,7 +3031,7 @@ static void sram_deinit(struct langwell_udc *dev) | |||
3031 | /* tear down the binding between this driver and the pci device */ | 3031 | /* tear down the binding between this driver and the pci device */ |
3032 | static void langwell_udc_remove(struct pci_dev *pdev) | 3032 | static void langwell_udc_remove(struct pci_dev *pdev) |
3033 | { | 3033 | { |
3034 | struct langwell_udc *dev = the_controller; | 3034 | struct langwell_udc *dev = pci_get_drvdata(pdev); |
3035 | 3035 | ||
3036 | DECLARE_COMPLETION(done); | 3036 | DECLARE_COMPLETION(done); |
3037 | 3037 | ||
@@ -3378,7 +3378,7 @@ error: | |||
3378 | /* device controller suspend */ | 3378 | /* device controller suspend */ |
3379 | static int langwell_udc_suspend(struct pci_dev *pdev, pm_message_t state) | 3379 | static int langwell_udc_suspend(struct pci_dev *pdev, pm_message_t state) |
3380 | { | 3380 | { |
3381 | struct langwell_udc *dev = the_controller; | 3381 | struct langwell_udc *dev = pci_get_drvdata(pdev); |
3382 | 3382 | ||
3383 | dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); | 3383 | dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); |
3384 | 3384 | ||
@@ -3426,7 +3426,7 @@ static int langwell_udc_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3426 | /* device controller resume */ | 3426 | /* device controller resume */ |
3427 | static int langwell_udc_resume(struct pci_dev *pdev) | 3427 | static int langwell_udc_resume(struct pci_dev *pdev) |
3428 | { | 3428 | { |
3429 | struct langwell_udc *dev = the_controller; | 3429 | struct langwell_udc *dev = pci_get_drvdata(pdev); |
3430 | size_t size; | 3430 | size_t size; |
3431 | 3431 | ||
3432 | dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); | 3432 | dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); |
@@ -3508,7 +3508,7 @@ static int langwell_udc_resume(struct pci_dev *pdev) | |||
3508 | /* pci driver shutdown */ | 3508 | /* pci driver shutdown */ |
3509 | static void langwell_udc_shutdown(struct pci_dev *pdev) | 3509 | static void langwell_udc_shutdown(struct pci_dev *pdev) |
3510 | { | 3510 | { |
3511 | struct langwell_udc *dev = the_controller; | 3511 | struct langwell_udc *dev = pci_get_drvdata(pdev); |
3512 | u32 usbmode; | 3512 | u32 usbmode; |
3513 | 3513 | ||
3514 | dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); | 3514 | dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); |