Commit bc6f328c authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] I2C: minor isp1301_omap tweaks

Minor cleanups to the isp130_omap driver:  enable the right
amount of VBUS current draw in non-OTG configurations; get rid
of a warning from GCC 2.95.3 ("int" function returns no value);
use kcalloc() not kmalloc+memset.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 7413482b
...@@ -934,13 +934,14 @@ static void otg_unbind(struct isp1301 *isp) ...@@ -934,13 +934,14 @@ static void otg_unbind(struct isp1301 *isp)
static void b_peripheral(struct isp1301 *isp) static void b_peripheral(struct isp1301 *isp)
{ {
enable_vbus_draw(isp, 8);
OTG_CTRL_REG = OTG_CTRL_REG & OTG_XCEIV_OUTPUTS; OTG_CTRL_REG = OTG_CTRL_REG & OTG_XCEIV_OUTPUTS;
usb_gadget_vbus_connect(isp->otg.gadget); usb_gadget_vbus_connect(isp->otg.gadget);
#ifdef CONFIG_USB_OTG #ifdef CONFIG_USB_OTG
enable_vbus_draw(isp, 8);
otg_update_isp(isp); otg_update_isp(isp);
#else #else
enable_vbus_draw(isp, 100);
/* UDC driver just set OTG_BSESSVLD */ /* UDC driver just set OTG_BSESSVLD */
isp1301_set_bits(isp, ISP1301_OTG_CONTROL_1, OTG1_DP_PULLUP); isp1301_set_bits(isp, ISP1301_OTG_CONTROL_1, OTG1_DP_PULLUP);
isp1301_clear_bits(isp, ISP1301_OTG_CONTROL_1, OTG1_DP_PULLDOWN); isp1301_clear_bits(isp, ISP1301_OTG_CONTROL_1, OTG1_DP_PULLDOWN);
...@@ -950,7 +951,7 @@ static void b_peripheral(struct isp1301 *isp) ...@@ -950,7 +951,7 @@ static void b_peripheral(struct isp1301 *isp)
#endif #endif
} }
static int isp_update_otg(struct isp1301 *isp, u8 stat) static void isp_update_otg(struct isp1301 *isp, u8 stat)
{ {
u8 isp_stat, isp_bstat; u8 isp_stat, isp_bstat;
enum usb_otg_state state = isp->otg.state; enum usb_otg_state state = isp->otg.state;
...@@ -1489,12 +1490,10 @@ static int isp1301_probe(struct i2c_adapter *bus, int address, int kind) ...@@ -1489,12 +1490,10 @@ static int isp1301_probe(struct i2c_adapter *bus, int address, int kind)
if (the_transceiver) if (the_transceiver)
return 0; return 0;
isp = kmalloc(sizeof *isp, GFP_KERNEL); isp = kcalloc(1, sizeof *isp, GFP_KERNEL);
if (!isp) if (!isp)
return 0; return 0;
memset(isp, 0, sizeof *isp);
INIT_WORK(&isp->work, isp1301_work, isp); INIT_WORK(&isp->work, isp1301_work, isp);
init_timer(&isp->timer); init_timer(&isp->timer);
isp->timer.function = isp1301_timer; isp->timer.function = isp1301_timer;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment