aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ipw.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-13 20:18:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-13 20:18:16 -0400
commit592ba39fab1072d6d37f4118f4b0efa15377ced5 (patch)
treecd8bb392f0653299c487287eaac4b8a3b2bb8db9 /drivers/usb/serial/ipw.c
parent96fc8e8d8551f4d67b54982175b412c4e1b8d395 (diff)
USB: serial: ipw.c: remove dbg() usage
dbg() was a very old USB-serial-specific macro. This patch removes it from being used in the driver and uses dev_dbg() instead. CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> CC: "Bjørn Mork" <bjorn@mork.no> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/ipw.c')
-rw-r--r--drivers/usb/serial/ipw.c61
1 files changed, 28 insertions, 33 deletions
diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index 2cb30c535839..fbd54a1bab30 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -142,7 +142,8 @@ static bool debug;
142 142
143static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port) 143static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)
144{ 144{
145 struct usb_device *dev = port->serial->dev; 145 struct usb_device *udev = port->serial->dev;
146 struct device *dev = &port->dev;
146 u8 buf_flow_static[16] = IPW_BYTES_FLOWINIT; 147 u8 buf_flow_static[16] = IPW_BYTES_FLOWINIT;
147 u8 *buf_flow_init; 148 u8 *buf_flow_init;
148 int result; 149 int result;
@@ -154,8 +155,8 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)
154 /* --1: Tell the modem to initialize (we think) From sniffs this is 155 /* --1: Tell the modem to initialize (we think) From sniffs this is
155 * always the first thing that gets sent to the modem during 156 * always the first thing that gets sent to the modem during
156 * opening of the device */ 157 * opening of the device */
157 dbg("%s: Sending SIO_INIT (we guess)", __func__); 158 dev_dbg(dev, "%s: Sending SIO_INIT (we guess)\n", __func__);
158 result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 159 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
159 IPW_SIO_INIT, 160 IPW_SIO_INIT,
160 USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT, 161 USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT,
161 0, 162 0,
@@ -164,22 +165,19 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)
164 0, 165 0,
165 100000); 166 100000);
166 if (result < 0) 167 if (result < 0)
167 dev_err(&port->dev, 168 dev_err(dev, "Init of modem failed (error = %d)\n", result);
168 "Init of modem failed (error = %d)\n", result);
169 169
170 /* reset the bulk pipes */ 170 /* reset the bulk pipes */
171 usb_clear_halt(dev, 171 usb_clear_halt(udev, usb_rcvbulkpipe(udev, port->bulk_in_endpointAddress));
172 usb_rcvbulkpipe(dev, port->bulk_in_endpointAddress)); 172 usb_clear_halt(udev, usb_sndbulkpipe(udev, port->bulk_out_endpointAddress));
173 usb_clear_halt(dev,
174 usb_sndbulkpipe(dev, port->bulk_out_endpointAddress));
175 173
176 /*--2: Start reading from the device */ 174 /*--2: Start reading from the device */
177 dbg("%s: setting up bulk read callback", __func__); 175 dev_dbg(dev, "%s: setting up bulk read callback\n", __func__);
178 usb_wwan_open(tty, port); 176 usb_wwan_open(tty, port);
179 177
180 /*--3: Tell the modem to open the floodgates on the rx bulk channel */ 178 /*--3: Tell the modem to open the floodgates on the rx bulk channel */
181 dbg("%s:asking modem for RxRead (RXBULK_ON)", __func__); 179 dev_dbg(dev, "%s:asking modem for RxRead (RXBULK_ON)\n", __func__);
182 result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 180 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
183 IPW_SIO_RXCTL, 181 IPW_SIO_RXCTL,
184 USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT, 182 USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT,
185 IPW_RXBULK_ON, 183 IPW_RXBULK_ON,
@@ -188,12 +186,11 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)
188 0, 186 0,
189 100000); 187 100000);
190 if (result < 0) 188 if (result < 0)
191 dev_err(&port->dev, 189 dev_err(dev, "Enabling bulk RxRead failed (error = %d)\n", result);
192 "Enabling bulk RxRead failed (error = %d)\n", result);
193 190
194 /*--4: setup the initial flowcontrol */ 191 /*--4: setup the initial flowcontrol */
195 dbg("%s:setting init flowcontrol (%s)", __func__, buf_flow_init); 192 dev_dbg(dev, "%s:setting init flowcontrol (%s)\n", __func__, buf_flow_init);
196 result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 193 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
197 IPW_SIO_HANDFLOW, 194 IPW_SIO_HANDFLOW,
198 USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT, 195 USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT,
199 0, 196 0,
@@ -202,8 +199,7 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)
202 0x10, 199 0x10,
203 200000); 200 200000);
204 if (result < 0) 201 if (result < 0)
205 dev_err(&port->dev, 202 dev_err(dev, "initial flowcontrol failed (error = %d)\n", result);
206 "initial flowcontrol failed (error = %d)\n", result);
207 203
208 kfree(buf_flow_init); 204 kfree(buf_flow_init);
209 return 0; 205 return 0;
@@ -233,12 +229,13 @@ static void ipw_release(struct usb_serial *serial)
233 229
234static void ipw_dtr_rts(struct usb_serial_port *port, int on) 230static void ipw_dtr_rts(struct usb_serial_port *port, int on)
235{ 231{
236 struct usb_device *dev = port->serial->dev; 232 struct usb_device *udev = port->serial->dev;
233 struct device *dev = &port->dev;
237 int result; 234 int result;
238 235
239 dbg("%s: on = %d", __func__, on); 236 dev_dbg(dev, "%s: on = %d\n", __func__, on);
240 237
241 result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 238 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
242 IPW_SIO_SET_PIN, 239 IPW_SIO_SET_PIN,
243 USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT, 240 USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT,
244 on ? IPW_PIN_SETDTR : IPW_PIN_CLRDTR, 241 on ? IPW_PIN_SETDTR : IPW_PIN_CLRDTR,
@@ -247,10 +244,9 @@ static void ipw_dtr_rts(struct usb_serial_port *port, int on)
247 0, 244 0,
248 200000); 245 200000);
249 if (result < 0) 246 if (result < 0)
250 dev_err(&port->dev, "setting dtr failed (error = %d)\n", 247 dev_err(dev, "setting dtr failed (error = %d)\n", result);
251 result);
252 248
253 result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 249 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
254 IPW_SIO_SET_PIN, USB_TYPE_VENDOR | 250 IPW_SIO_SET_PIN, USB_TYPE_VENDOR |
255 USB_RECIP_INTERFACE | USB_DIR_OUT, 251 USB_RECIP_INTERFACE | USB_DIR_OUT,
256 on ? IPW_PIN_SETRTS : IPW_PIN_CLRRTS, 252 on ? IPW_PIN_SETRTS : IPW_PIN_CLRRTS,
@@ -259,18 +255,18 @@ static void ipw_dtr_rts(struct usb_serial_port *port, int on)
259 0, 255 0,
260 200000); 256 200000);
261 if (result < 0) 257 if (result < 0)
262 dev_err(&port->dev, "setting rts failed (error = %d)\n", 258 dev_err(dev, "setting rts failed (error = %d)\n", result);
263 result);
264} 259}
265 260
266static void ipw_close(struct usb_serial_port *port) 261static void ipw_close(struct usb_serial_port *port)
267{ 262{
268 struct usb_device *dev = port->serial->dev; 263 struct usb_device *udev = port->serial->dev;
264 struct device *dev = &port->dev;
269 int result; 265 int result;
270 266
271 /*--3: purge */ 267 /*--3: purge */
272 dbg("%s:sending purge", __func__); 268 dev_dbg(dev, "%s:sending purge\n", __func__);
273 result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 269 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
274 IPW_SIO_PURGE, USB_TYPE_VENDOR | 270 IPW_SIO_PURGE, USB_TYPE_VENDOR |
275 USB_RECIP_INTERFACE | USB_DIR_OUT, 271 USB_RECIP_INTERFACE | USB_DIR_OUT,
276 0x03, 272 0x03,
@@ -279,12 +275,12 @@ static void ipw_close(struct usb_serial_port *port)
279 0, 275 0,
280 200000); 276 200000);
281 if (result < 0) 277 if (result < 0)
282 dev_err(&port->dev, "purge failed (error = %d)\n", result); 278 dev_err(dev, "purge failed (error = %d)\n", result);
283 279
284 280
285 /* send RXBULK_off (tell modem to stop transmitting bulk data on 281 /* send RXBULK_off (tell modem to stop transmitting bulk data on
286 rx chan) */ 282 rx chan) */
287 result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 283 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
288 IPW_SIO_RXCTL, 284 IPW_SIO_RXCTL,
289 USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT, 285 USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT,
290 IPW_RXBULK_OFF, 286 IPW_RXBULK_OFF,
@@ -294,8 +290,7 @@ static void ipw_close(struct usb_serial_port *port)
294 100000); 290 100000);
295 291
296 if (result < 0) 292 if (result < 0)
297 dev_err(&port->dev, 293 dev_err(dev, "Disabling bulk RxRead failed (error = %d)\n", result);
298 "Disabling bulk RxRead failed (error = %d)\n", result);
299 294
300 usb_wwan_close(port); 295 usb_wwan_close(port);
301} 296}