diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2011-04-28 03:40:54 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-29 20:24:33 -0400 |
commit | 206dcc2cfe15b6174f15293ae15a097ee03eb386 (patch) | |
tree | ee7ce46c95392414748b3f3dde26f8eee2280238 /drivers | |
parent | f429ea3f3488e1a0683f6f9ce76b420b5ebd2d63 (diff) |
usb: renesas_usbhs: move pdev_to_priv to global
usbhs_pdev_to_priv function will be used in other files.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/renesas_usbhs/common.c | 14 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/common.h | 1 |
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index fda586d1f7d8..53be4443b5ed 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c | |||
@@ -56,6 +56,11 @@ void usbhs_bset(struct usbhs_priv *priv, u32 reg, u16 mask, u16 data) | |||
56 | usbhs_write(priv, reg, val); | 56 | usbhs_write(priv, reg, val); |
57 | } | 57 | } |
58 | 58 | ||
59 | struct usbhs_priv *usbhs_pdev_to_priv(struct platform_device *pdev) | ||
60 | { | ||
61 | return dev_get_drvdata(&pdev->dev); | ||
62 | } | ||
63 | |||
59 | /* | 64 | /* |
60 | * syscfg functions | 65 | * syscfg functions |
61 | */ | 66 | */ |
@@ -113,11 +118,6 @@ int usbhs_frame_get_num(struct usbhs_priv *priv) | |||
113 | /* | 118 | /* |
114 | * local functions | 119 | * local functions |
115 | */ | 120 | */ |
116 | static struct usbhs_priv *usbhsc_pdev_to_priv(struct platform_device *pdev) | ||
117 | { | ||
118 | return dev_get_drvdata(&pdev->dev); | ||
119 | } | ||
120 | |||
121 | static void usbhsc_bus_ctrl(struct usbhs_priv *priv, int enable) | 121 | static void usbhsc_bus_ctrl(struct usbhs_priv *priv, int enable) |
122 | { | 122 | { |
123 | int wait = usbhs_get_dparam(priv, buswait_bwait); | 123 | int wait = usbhs_get_dparam(priv, buswait_bwait); |
@@ -210,7 +210,7 @@ static void usbhsc_notify_hotplug(struct work_struct *work) | |||
210 | 210 | ||
211 | static int usbhsc_drvcllbck_notify_hotplug(struct platform_device *pdev) | 211 | static int usbhsc_drvcllbck_notify_hotplug(struct platform_device *pdev) |
212 | { | 212 | { |
213 | struct usbhs_priv *priv = usbhsc_pdev_to_priv(pdev); | 213 | struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev); |
214 | 214 | ||
215 | /* | 215 | /* |
216 | * This functions will be called in interrupt. | 216 | * This functions will be called in interrupt. |
@@ -351,7 +351,7 @@ probe_end_kfree: | |||
351 | 351 | ||
352 | static int __devexit usbhs_remove(struct platform_device *pdev) | 352 | static int __devexit usbhs_remove(struct platform_device *pdev) |
353 | { | 353 | { |
354 | struct usbhs_priv *priv = usbhsc_pdev_to_priv(pdev); | 354 | struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev); |
355 | struct renesas_usbhs_platform_info *info = pdev->dev.platform_data; | 355 | struct renesas_usbhs_platform_info *info = pdev->dev.platform_data; |
356 | struct renesas_usbhs_driver_callback *dfunc = &info->driver_callback; | 356 | struct renesas_usbhs_driver_callback *dfunc = &info->driver_callback; |
357 | 357 | ||
diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h index f1a2b62f93f9..f3b907d26082 100644 --- a/drivers/usb/renesas_usbhs/common.h +++ b/drivers/usb/renesas_usbhs/common.h | |||
@@ -217,6 +217,7 @@ int usbhs_frame_get_num(struct usbhs_priv *priv); | |||
217 | /* | 217 | /* |
218 | * data | 218 | * data |
219 | */ | 219 | */ |
220 | struct usbhs_priv *usbhs_pdev_to_priv(struct platform_device *pdev); | ||
220 | #define usbhs_get_dparam(priv, param) (priv->dparam->param) | 221 | #define usbhs_get_dparam(priv, param) (priv->dparam->param) |
221 | #define usbhs_priv_to_pdev(priv) (priv->pdev) | 222 | #define usbhs_priv_to_pdev(priv) (priv->pdev) |
222 | #define usbhs_priv_to_dev(priv) (&priv->pdev->dev) | 223 | #define usbhs_priv_to_dev(priv) (&priv->pdev->dev) |