summaryrefslogtreecommitdiff
path: root/drivers/usb/renesas_usbhs/rza2.c
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2019-06-25 08:38:56 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-26 05:33:09 +0300
commit76eff170bb05e59218008a21df670cb7177110e4 (patch)
treee2a0eb748d3e51e9689b243459354621549404e2 /drivers/usb/renesas_usbhs/rza2.c
parentbe0a42a7d62605cfcabd8cbba6c104a80471cd94 (diff)
downloadlinux-76eff170bb05e59218008a21df670cb7177110e4.tar.xz
usb: renesas_usbhs: Use renesas_usbhs_platform_info on of_device_id.data
In device tree environment, the previous code allocates renesas_usbhs_platform_info by using devm_kzalloc() and then copies usbhs_of_data to the allocated memory. This reason is some values (e.g. .platform_callback.get_vbus) are overwritten by the driver, but the of_device_id.data is "const". Now the driver doesn't have such a code, so this patch uses renesas_usbhs_platform_info on of_device_id.data. Note that the previous code set the pdev->dev.platform_data pointer even if device tree environment, but the value is not used. So, this patch also remove such a code. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/renesas_usbhs/rza2.c')
-rw-r--r--drivers/usb/renesas_usbhs/rza2.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/usb/renesas_usbhs/rza2.c b/drivers/usb/renesas_usbhs/rza2.c
index 6e32768bc9ba..021749594389 100644
--- a/drivers/usb/renesas_usbhs/rza2.c
+++ b/drivers/usb/renesas_usbhs/rza2.c
@@ -59,9 +59,16 @@ static int usbhs_rza2_power_ctrl(struct platform_device *pdev,
return retval;
}
-const struct renesas_usbhs_platform_callback usbhs_rza2_ops = {
- .hardware_init = usbhs_rza2_hardware_init,
- .hardware_exit = usbhs_rza2_hardware_exit,
- .power_ctrl = usbhs_rza2_power_ctrl,
- .get_id = usbhs_get_id_as_gadget,
+const struct renesas_usbhs_platform_info usbhs_rza2_plat_info = {
+ .platform_callback = {
+ .hardware_init = usbhs_rza2_hardware_init,
+ .hardware_exit = usbhs_rza2_hardware_exit,
+ .power_ctrl = usbhs_rza2_power_ctrl,
+ .get_id = usbhs_get_id_as_gadget,
+ },
+ .driver_param = {
+ .has_cnen = 1,
+ .cfifo_byte_addr = 1,
+ .has_new_pipe_configs = 1,
+ },
};