Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
usbbuf = kzalloc(sizeof(u8)*USBCAN_BITTIMING_CONST_SIZE, GFP_KERNEL);
if(!usbbuf){
usbbuf = kzalloc(sizeof(u8)*USBCAN_BITTIMING_CONST_SIZE, GFP_KERNEL);
if(!usbbuf){
- err("Error allocating receive buffer for bittiming constants\n");
+ netdev_err(dev->netdev, "Error allocating receive buffer for bittiming constants\n");
usbbuf = kzalloc(sizeof(u8)*USBCAN_BITTIMING_SIZE, GFP_KERNEL);
if(!usbbuf){
usbbuf = kzalloc(sizeof(u8)*USBCAN_BITTIMING_SIZE, GFP_KERNEL);
if(!usbbuf){
- err("Error allocating transmit buffer for set bittiming\n");
+ netdev_err(netdev, "Error allocating transmit buffer for set bittiming\n");
- err("Could not set bittiming\n");
+ netdev_err(netdev, "Could not set bittiming\n");
return;
if (urb->status != 0){
return;
if (urb->status != 0){
- err("TX callback: error");
+ netdev_err(m->dev->netdev, "TX callback: error");
- err("RX callback: error");
+ netdev_err(m->dev->netdev, "RX callback: error");
/* send*/
retval = usb_submit_urb(m->u, GFP_ATOMIC);
if (retval){
/* send*/
retval = usb_submit_urb(m->u, GFP_ATOMIC);
if (retval){
- err("Error submitting URB: %d", retval);
+ netdev_err(netdev, "Error submitting URB: %d", retval);
can_free_echo_skb(netdev, m->echo_index);
usbcan_usb_message_move_list(dev, m, &dev->tx_idle_list);
dev_kfree_skb(skb);
can_free_echo_skb(netdev, m->echo_index);
usbcan_usb_message_move_list(dev, m, &dev->tx_idle_list);
dev_kfree_skb(skb);
u8 *ptr;
int i, len, retval;
u16 flags = 0;
u8 *ptr;
int i, len, retval;
u16 flags = 0;
- struct net_device_stats *stats = &m->dev->netdev->stats;
+ struct net_device *netdev = m->dev->netdev;
+ struct net_device_stats *stats = &netdev->stats;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)
- err("RX: error alloc skb\n");
+ netdev_err(netdev, "RX: error alloc skb\n");
usbcan_usb_message_move_list(dev, m, &dev->rx_pend_list);
retval = usb_submit_urb (m->u, GFP_KERNEL);
if (retval<0) {
usbcan_usb_message_move_list(dev, m, &dev->rx_pend_list);
retval = usb_submit_urb (m->u, GFP_KERNEL);
if (retval<0) {
- err("URB error %d\n", retval);
+ netdev_err(netdev, "URB error %d\n", retval);
m = kzalloc(sizeof(struct usbcan_message), GFP_KERNEL);
if (!u){
m = kzalloc(sizeof(struct usbcan_message), GFP_KERNEL);
if (!u){
- err("Error allocating usb receive urb");
+ netdev_err(dev->netdev, "Error allocating usb receive urb");
goto exit;
}
if(!m) {
usb_free_urb(u);
goto exit;
}
if(!m) {
usb_free_urb(u);
- err("Error allocating receive usbcan_message");
+ netdev_err(dev->netdev, "Error allocating receive usbcan_message");
m = kzalloc(sizeof(struct usbcan_message), GFP_KERNEL);
if (!u){
m = kzalloc(sizeof(struct usbcan_message), GFP_KERNEL);
if (!u){
- err("Error allocating usb transmit urb");
+ netdev_err(dev->netdev, "Error allocating usb transmit urb");
goto exit;
}
if(!m) {
usb_free_urb(u);
goto exit;
}
if(!m) {
usb_free_urb(u);
- err("Error allocating transmit usbcan_message");
+ netdev_err(dev->netdev, "Error allocating transmit usbcan_message");
retval=usb_submit_urb(m->u, GFP_KERNEL);
if (retval){
retval=usb_submit_urb(m->u, GFP_KERNEL);
if (retval){
- err("Error submitting URB: %d", retval);
+ netdev_err(dev->netdev, "Error submitting URB: %d", retval);
}
}
if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) {
}
}
if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) {
- err("Could not find both bulk-in and bulk-out endpoints");
+ dev_err(&intf->dev, "Could not find both bulk-in and bulk-out endpoints");
SET_NETDEV_DEV(netdev, &intf->dev);
if (get_bittiming_constants(dev)){
SET_NETDEV_DEV(netdev, &intf->dev);
if (get_bittiming_constants(dev)){
- err("Could not get bittiming constants\n");
+ dev_err(&intf->dev, "Could not get bittiming constants\n");
/* register this driver with the USB subsystem */
result = usb_register(&ctu_usbcan_driver);
if (result)
/* register this driver with the USB subsystem */
result = usb_register(&ctu_usbcan_driver);
if (result)
- err("usb_register failed. Error number %d", result);
+ pr_err("usb_register failed. Error number %d", result);