On 02/11/2018 11:44 AM, Jagan Teki wrote: > On Tue, Feb 6, 2018 at 8:09 PM, Marek Vasut <ma...@denx.de> wrote: >> On 02/06/2018 03:25 PM, Jagan Teki wrote: >>> Filling musb_hdrc pdata using structure will unnecessary >>> add extra ifdefs, so fill them inside probe call for >>> better code understanding and get rid ifdefs using >>> devicetree compatible. >>> >>> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com> >>> --- >>> drivers/usb/musb-new/sunxi.c | 22 +++++++++------------- >>> 1 file changed, 9 insertions(+), 13 deletions(-) >>> >>> diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c >>> index 3f3b898..0b7ff9f 100644 >>> --- a/drivers/usb/musb-new/sunxi.c >>> +++ b/drivers/usb/musb-new/sunxi.c >>> @@ -308,22 +308,12 @@ static struct musb_hdrc_config musb_config = { >>> .ram_bits = SUNXI_MUSB_RAM_BITS, >>> }; >>> >>> -static struct musb_hdrc_platform_data musb_plat = { >>> -#if defined(CONFIG_USB_MUSB_HOST) >>> - .mode = MUSB_HOST, >>> -#else >>> - .mode = MUSB_PERIPHERAL, >>> -#endif >>> - .config = &musb_config, >>> - .power = 250, >>> - .platform_ops = &sunxi_musb_ops, >>> -}; >>> - >>> static int musb_usb_probe(struct udevice *dev) >>> { >>> struct sunxi_glue *glue = dev_get_priv(dev); >>> struct musb_host_data *host = &glue->mdata; >>> struct usb_bus_priv *priv = dev_get_uclass_priv(dev); >>> + struct musb_hdrc_platform_data pdata; >> >> Make this pdata = musb_plat and then tweak pdata down below to avoid >> assigning all the values there. > > Thought the same, but we have hardly two members power and > platform_ops and reaming mode and other need to assign with SOC basic > and CONFIG_
Three, but OK -- Best regards, Marek Vasut _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot