diff options
Diffstat (limited to 'drivers/usb/host/ohci-pnx4008.c')
-rw-r--r-- | drivers/usb/host/ohci-pnx4008.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/usb/host/ohci-pnx4008.c b/drivers/usb/host/ohci-pnx4008.c index 28b458f20cc3..6ad8f2fc57b9 100644 --- a/drivers/usb/host/ohci-pnx4008.c +++ b/drivers/usb/host/ohci-pnx4008.c | |||
@@ -109,8 +109,6 @@ static struct clk *usb_clk; | |||
109 | 109 | ||
110 | static int isp1301_probe(struct i2c_adapter *adap); | 110 | static int isp1301_probe(struct i2c_adapter *adap); |
111 | static int isp1301_detach(struct i2c_client *client); | 111 | static int isp1301_detach(struct i2c_client *client); |
112 | static int isp1301_command(struct i2c_client *client, unsigned int cmd, | ||
113 | void *arg); | ||
114 | 112 | ||
115 | static const unsigned short normal_i2c[] = | 113 | static const unsigned short normal_i2c[] = |
116 | { ISP1301_I2C_ADDR, ISP1301_I2C_ADDR + 1, I2C_CLIENT_END }; | 114 | { ISP1301_I2C_ADDR, ISP1301_I2C_ADDR + 1, I2C_CLIENT_END }; |
@@ -123,30 +121,37 @@ static struct i2c_client_address_data addr_data = { | |||
123 | }; | 121 | }; |
124 | 122 | ||
125 | struct i2c_driver isp1301_driver = { | 123 | struct i2c_driver isp1301_driver = { |
126 | .class = I2C_CLASS_HWMON, | 124 | .driver = { |
125 | .name = "isp1301_pnx", | ||
126 | }, | ||
127 | .attach_adapter = isp1301_probe, | 127 | .attach_adapter = isp1301_probe, |
128 | .detach_client = isp1301_detach, | 128 | .detach_client = isp1301_detach, |
129 | .command = isp1301_command | ||
130 | }; | 129 | }; |
131 | 130 | ||
132 | static int isp1301_attach(struct i2c_adapter *adap, int addr, int kind) | 131 | static int isp1301_attach(struct i2c_adapter *adap, int addr, int kind) |
133 | { | 132 | { |
134 | struct i2c_client *c; | 133 | struct i2c_client *c; |
134 | int err; | ||
135 | 135 | ||
136 | c = kzalloc(sizeof(*c), GFP_KERNEL); | 136 | c = kzalloc(sizeof(*c), GFP_KERNEL); |
137 | |||
138 | if (!c) | 137 | if (!c) |
139 | return -ENOMEM; | 138 | return -ENOMEM; |
140 | 139 | ||
141 | strcpy(c->name, "isp1301"); | 140 | strlcpy(c->name, "isp1301_pnx", I2C_NAME_SIZE); |
142 | c->flags = 0; | 141 | c->flags = 0; |
143 | c->addr = addr; | 142 | c->addr = addr; |
144 | c->adapter = adap; | 143 | c->adapter = adap; |
145 | c->driver = &isp1301_driver; | 144 | c->driver = &isp1301_driver; |
146 | 145 | ||
146 | err = i2c_attach_client(c); | ||
147 | if (err) { | ||
148 | kfree(c); | ||
149 | return err; | ||
150 | } | ||
151 | |||
147 | isp1301_i2c_client = c; | 152 | isp1301_i2c_client = c; |
148 | 153 | ||
149 | return i2c_attach_client(c); | 154 | return 0; |
150 | } | 155 | } |
151 | 156 | ||
152 | static int isp1301_probe(struct i2c_adapter *adap) | 157 | static int isp1301_probe(struct i2c_adapter *adap) |
@@ -161,13 +166,6 @@ static int isp1301_detach(struct i2c_client *client) | |||
161 | return 0; | 166 | return 0; |
162 | } | 167 | } |
163 | 168 | ||
164 | /* No commands defined */ | ||
165 | static int isp1301_command(struct i2c_client *client, unsigned int cmd, | ||
166 | void *arg) | ||
167 | { | ||
168 | return 0; | ||
169 | } | ||
170 | |||
171 | static void i2c_write(u8 buf, u8 subaddr) | 169 | static void i2c_write(u8 buf, u8 subaddr) |
172 | { | 170 | { |
173 | char tmpbuf[2]; | 171 | char tmpbuf[2]; |
@@ -389,7 +387,7 @@ static int __devinit usb_hcd_pnx4008_probe(struct platform_device *pdev) | |||
389 | while ((__raw_readl(USB_OTG_CLK_STAT) & USB_CLOCK_MASK) != | 387 | while ((__raw_readl(USB_OTG_CLK_STAT) & USB_CLOCK_MASK) != |
390 | USB_CLOCK_MASK) ; | 388 | USB_CLOCK_MASK) ; |
391 | 389 | ||
392 | hcd = usb_create_hcd (driver, &pdev->dev, pdev->dev.bus_id); | 390 | hcd = usb_create_hcd (driver, &pdev->dev, dev_name(&pdev->dev)); |
393 | if (!hcd) { | 391 | if (!hcd) { |
394 | err("Failed to allocate HC buffer"); | 392 | err("Failed to allocate HC buffer"); |
395 | ret = -ENOMEM; | 393 | ret = -ENOMEM; |