diff options
author | Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | 2019-06-25 14:38:54 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-26 10:33:09 +0800 |
commit | b3103d0b022f8ce87d68994417bbf2765329da3a (patch) | |
tree | d06d718897478a0cf882222e47285cebc74bd9d1 /drivers/usb/renesas_usbhs | |
parent | f08acaf0096380235e2657089d8a5e09f6d4213f (diff) |
usb: renesas_usbhs: move device tree properties parsing
In the future, each struct renesas_usbhs_driver_param is stored on
the each platform related source code (e.g. rcar3.c) to remove
usbhs_parse_dt(). So, this patch moves device tree properties
parsing to usbhs_probe().
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')
-rw-r--r-- | drivers/usb/renesas_usbhs/common.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 379b4a0e1d06..dc5e80d12a62 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -628,8 +628,6 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev) struct renesas_usbhs_platform_info *info; struct renesas_usbhs_driver_param *dparam; const struct usbhs_of_data *data; - u32 tmp; - int gpio; info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); if (!info) @@ -643,13 +641,6 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev) *dparam = data->param; info->platform_callback = *data->platform_callback; - if (!of_property_read_u32(dev_of_node(dev), "renesas,buswait", &tmp)) - dparam->buswait_bwait = tmp; - gpio = of_get_named_gpio_flags(dev_of_node(dev), "renesas,enable-gpio", - 0, NULL); - if (gpio > 0) - dparam->enable_gpio = gpio; - return info; } @@ -659,7 +650,8 @@ static int usbhs_probe(struct platform_device *pdev) struct usbhs_priv *priv; struct resource *res, *irq_res; struct device *dev = &pdev->dev; - int ret; + int ret, gpio; + u32 tmp; /* check device node */ if (dev_of_node(dev)) @@ -720,6 +712,12 @@ static int usbhs_probe(struct platform_device *pdev) } if (!priv->dparam.pio_dma_border) priv->dparam.pio_dma_border = 64; /* 64byte */ + if (!of_property_read_u32(dev_of_node(dev), "renesas,buswait", &tmp)) + priv->dparam.buswait_bwait = tmp; + gpio = of_get_named_gpio_flags(dev_of_node(dev), "renesas,enable-gpio", + 0, NULL); + if (gpio > 0) + priv->dparam.enable_gpio = gpio; /* FIXME */ /* runtime power control ? */ |