usb: musb-new: Allow the diver not to use the set_phy_power() callback
The set_phy_power() callback is part of struct omap_musb_board_data. This
structure is part of the platform data passed to the musb-new driver. This
does not really fit with the Driver Model, so allow not to use struct
omap_musb_board_data to turn the phy on or off.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/drivers/usb/musb-new/musb_dsps.c b/drivers/usb/musb-new/musb_dsps.c
index 9b814f4..0c794b3 100644
--- a/drivers/usb/musb-new/musb_dsps.c
+++ b/drivers/usb/musb-new/musb_dsps.c
@@ -450,7 +450,7 @@
dsps_writel(reg_base, wrp->control, (1 << wrp->reset));
/* Start the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 1);
musb->isr = dsps_interrupt;
@@ -491,7 +491,7 @@
#endif
/* Shutdown the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 0);
#ifndef __UBOOT__
@@ -691,7 +691,7 @@
struct omap_musb_board_data *data = plat->board_data;
/* Shutdown the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 0);
return 0;
@@ -703,7 +703,7 @@
struct omap_musb_board_data *data = plat->board_data;
/* Start the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 1);
return 0;