Merge tag 'linux-can-next-for-3.15-20140317' of git://gitorious.org/linux-can/linux...
authorDavid S. Miller <davem@davemloft.net>
Tue, 18 Mar 2014 19:20:00 +0000 (15:20 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Mar 2014 19:20:00 +0000 (15:20 -0400)
linux-can-next-for-3.15-20140317

Marc Kleine-Budde says:

====================
this is a pull request of three patches for net-next/master.

It consists of a patch by Oliver Hartkopp, which unifies the MTU
settings for CAN interfaces. A patch by Christopher R. Baker populates
netdev::dev_id for udev discrimination for multi interface CAN devices.
Alexander Shiyan contributes a patch for the mcp251x driver which fixes
the regulators operation if CONFIG_REGULATOR is not enabled.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
25 files changed:
drivers/net/can/at91_can.c
drivers/net/can/bfin_can.c
drivers/net/can/c_can/c_can.c
drivers/net/can/cc770/cc770.c
drivers/net/can/flexcan.c
drivers/net/can/grcan.c
drivers/net/can/janz-ican3.c
drivers/net/can/mcp251x.c
drivers/net/can/mscan/mscan.c
drivers/net/can/pch_can.c
drivers/net/can/sja1000/ems_pci.c
drivers/net/can/sja1000/ems_pcmcia.c
drivers/net/can/sja1000/kvaser_pci.c
drivers/net/can/sja1000/peak_pci.c
drivers/net/can/sja1000/peak_pcmcia.c
drivers/net/can/sja1000/plx_pci.c
drivers/net/can/sja1000/sja1000.c
drivers/net/can/slcan.c
drivers/net/can/softing/softing_main.c
drivers/net/can/ti_hecc.c
drivers/net/can/usb/ems_usb.c
drivers/net/can/usb/esd_usb2.c
drivers/net/can/usb/kvaser_usb.c
drivers/net/can/usb/peak_usb/pcan_usb_core.c
drivers/net/can/usb/usb_8dev.c

index 1d00b95..f07fa89 100644 (file)
@@ -1194,6 +1194,7 @@ static const struct net_device_ops at91_netdev_ops = {
        .ndo_open       = at91_open,
        .ndo_stop       = at91_close,
        .ndo_start_xmit = at91_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 static ssize_t at91_sysfs_show_mb0_id(struct device *dev,
index 8d2b89a..543ecce 100644 (file)
@@ -528,6 +528,7 @@ static const struct net_device_ops bfin_can_netdev_ops = {
        .ndo_open               = bfin_can_open,
        .ndo_stop               = bfin_can_close,
        .ndo_start_xmit         = bfin_can_start_xmit,
+       .ndo_change_mtu         = can_change_mtu,
 };
 
 static int bfin_can_probe(struct platform_device *pdev)
index 951bfed..9c32e9e 100644 (file)
@@ -1277,6 +1277,7 @@ static const struct net_device_ops c_can_netdev_ops = {
        .ndo_open = c_can_open,
        .ndo_stop = c_can_close,
        .ndo_start_xmit = c_can_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 int register_c_can_dev(struct net_device *dev)
index 0f12abf..d837927 100644 (file)
@@ -823,6 +823,7 @@ static const struct net_device_ops cc770_netdev_ops = {
        .ndo_open = cc770_open,
        .ndo_stop = cc770_close,
        .ndo_start_xmit = cc770_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 int register_cc770dev(struct net_device *dev)
index c94d698..f425ec2 100644 (file)
@@ -1011,6 +1011,7 @@ static const struct net_device_ops flexcan_netdev_ops = {
        .ndo_open       = flexcan_open,
        .ndo_stop       = flexcan_close,
        .ndo_start_xmit = flexcan_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 static int register_flexcandev(struct net_device *dev)
index ab506d6..3fd9fd9 100644 (file)
@@ -1578,6 +1578,7 @@ static const struct net_device_ops grcan_netdev_ops = {
        .ndo_open       = grcan_open,
        .ndo_stop       = grcan_close,
        .ndo_start_xmit = grcan_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 static int grcan_setup_netdev(struct platform_device *ofdev,
index b47df5e..2382c04 100644 (file)
@@ -1594,6 +1594,7 @@ static const struct net_device_ops ican3_netdev_ops = {
        .ndo_open       = ican3_open,
        .ndo_stop       = ican3_stop,
        .ndo_start_xmit = ican3_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 /*
index 50aa630..28c11f8 100644 (file)
@@ -672,7 +672,7 @@ static int mcp251x_hw_probe(struct spi_device *spi)
 
 static int mcp251x_power_enable(struct regulator *reg, int enable)
 {
-       if (IS_ERR(reg))
+       if (IS_ERR_OR_NULL(reg))
                return 0;
 
        if (enable)
@@ -996,6 +996,7 @@ static const struct net_device_ops mcp251x_netdev_ops = {
        .ndo_open = mcp251x_open,
        .ndo_stop = mcp251x_stop,
        .ndo_start_xmit = mcp251x_hard_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 static const struct of_device_id mcp251x_of_match[] = {
@@ -1217,7 +1218,7 @@ static int __maybe_unused mcp251x_can_suspend(struct device *dev)
                priv->after_suspend = AFTER_SUSPEND_DOWN;
        }
 
-       if (!IS_ERR(priv->power)) {
+       if (!IS_ERR_OR_NULL(priv->power)) {
                regulator_disable(priv->power);
                priv->after_suspend |= AFTER_SUSPEND_POWER;
        }
index b9f3faa..e0c9be5 100644 (file)
@@ -647,9 +647,10 @@ static int mscan_close(struct net_device *dev)
 }
 
 static const struct net_device_ops mscan_netdev_ops = {
-       .ndo_open               = mscan_open,
-       .ndo_stop               = mscan_close,
-       .ndo_start_xmit         = mscan_start_xmit,
+       .ndo_open       = mscan_open,
+       .ndo_stop       = mscan_close,
+       .ndo_start_xmit = mscan_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 int register_mscandev(struct net_device *dev, int mscan_clksrc)
index 6c077eb..6472562 100644 (file)
@@ -950,6 +950,7 @@ static const struct net_device_ops pch_can_netdev_ops = {
        .ndo_open               = pch_can_open,
        .ndo_stop               = pch_close,
        .ndo_start_xmit         = pch_xmit,
+       .ndo_change_mtu         = can_change_mtu,
 };
 
 static void pch_can_remove(struct pci_dev *pdev)
index d790b87..fd13dbf 100644 (file)
@@ -323,6 +323,7 @@ static int ems_pci_add_card(struct pci_dev *pdev,
                        priv->cdr = EMS_PCI_CDR;
 
                        SET_NETDEV_DEV(dev, &pdev->dev);
+                       dev->dev_id = i;
 
                        if (card->version == 1)
                                /* reset int flag of pita */
index 9e535f2..381de99 100644 (file)
@@ -211,6 +211,7 @@ static int ems_pcmcia_add_card(struct pcmcia_device *pdev, unsigned long base)
                priv = netdev_priv(dev);
                priv->priv = card;
                SET_NETDEV_DEV(dev, &pdev->dev);
+               dev->dev_id = i;
 
                priv->irq_flags = IRQF_SHARED;
                dev->irq = pdev->irq;
index c96eb14..23b8e13 100644 (file)
@@ -270,6 +270,7 @@ static int kvaser_pci_add_chan(struct pci_dev *pdev, int channel,
                 priv->reg_base, board->conf_addr, dev->irq);
 
        SET_NETDEV_DEV(dev, &pdev->dev);
+       dev->dev_id = channel;
 
        /* Register SJA1000 device */
        err = register_sja1000dev(dev);
index 065ca49..c540e3d 100644 (file)
@@ -642,6 +642,7 @@ static int peak_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                icr |= chan->icr_mask;
 
                SET_NETDEV_DEV(dev, &pdev->dev);
+               dev->dev_id = i;
 
                /* Create chain of SJA1000 devices */
                chan->prev_dev = pci_get_drvdata(pdev);
index f7ad754..dd56133 100644 (file)
@@ -550,6 +550,7 @@ static int pcan_add_channels(struct pcan_pccard *card)
                priv = netdev_priv(netdev);
                priv->priv = card;
                SET_NETDEV_DEV(netdev, &pdev->dev);
+               netdev->dev_id = i;
 
                priv->irq_flags = IRQF_SHARED;
                netdev->irq = pdev->irq;
index fbb61a0..ec39b7c 100644 (file)
@@ -587,6 +587,7 @@ static int plx_pci_add_card(struct pci_dev *pdev,
                        priv->cdr = ci->cdr;
 
                        SET_NETDEV_DEV(dev, &pdev->dev);
+                       dev->dev_id = i;
 
                        /* Register SJA1000 device */
                        err = register_sja1000dev(dev);
index 55cce47..f31499a 100644 (file)
@@ -642,9 +642,10 @@ void free_sja1000dev(struct net_device *dev)
 EXPORT_SYMBOL_GPL(free_sja1000dev);
 
 static const struct net_device_ops sja1000_netdev_ops = {
-       .ndo_open               = sja1000_open,
-       .ndo_stop               = sja1000_close,
-       .ndo_start_xmit         = sja1000_start_xmit,
+       .ndo_open       = sja1000_open,
+       .ndo_stop       = sja1000_close,
+       .ndo_start_xmit = sja1000_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 int register_sja1000dev(struct net_device *dev)
index 3fcdae2..f5b16e0 100644 (file)
@@ -411,10 +411,16 @@ static void slc_free_netdev(struct net_device *dev)
        slcan_devs[i] = NULL;
 }
 
+static int slcan_change_mtu(struct net_device *dev, int new_mtu)
+{
+       return -EINVAL;
+}
+
 static const struct net_device_ops slc_netdev_ops = {
        .ndo_open               = slc_open,
        .ndo_stop               = slc_close,
        .ndo_start_xmit         = slc_xmit,
+       .ndo_change_mtu         = slcan_change_mtu,
 };
 
 static void slc_setup(struct net_device *dev)
index 9ea0dcd..7d8c8f3 100644 (file)
@@ -628,6 +628,7 @@ static const struct net_device_ops softing_netdev_ops = {
        .ndo_open = softing_netdev_open,
        .ndo_stop = softing_netdev_stop,
        .ndo_start_xmit = softing_netdev_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 static const struct can_bittiming_const softing_btr_const = {
@@ -832,6 +833,7 @@ static int softing_pdev_probe(struct platform_device *pdev)
                        ret = -ENOMEM;
                        goto netdev_failed;
                }
+               netdev->dev_id = j;
                priv = netdev_priv(card->net[j]);
                priv->index = j;
                ret = softing_netdev_register(netdev);
index 2c62fe6..258b9c4 100644 (file)
@@ -871,6 +871,7 @@ static const struct net_device_ops ti_hecc_netdev_ops = {
        .ndo_open               = ti_hecc_open,
        .ndo_stop               = ti_hecc_close,
        .ndo_start_xmit         = ti_hecc_xmit,
+       .ndo_change_mtu         = can_change_mtu,
 };
 
 static int ti_hecc_probe(struct platform_device *pdev)
index 52c42fd..00f2534 100644 (file)
@@ -883,6 +883,7 @@ static const struct net_device_ops ems_usb_netdev_ops = {
        .ndo_open = ems_usb_open,
        .ndo_stop = ems_usb_close,
        .ndo_start_xmit = ems_usb_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 static const struct can_bittiming_const ems_usb_bittiming_const = {
index 7fbe859..b7c9e8b 100644 (file)
@@ -888,6 +888,7 @@ static const struct net_device_ops esd_usb2_netdev_ops = {
        .ndo_open = esd_usb2_open,
        .ndo_stop = esd_usb2_close,
        .ndo_start_xmit = esd_usb2_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 static const struct can_bittiming_const esd_usb2_bittiming_const = {
@@ -1024,6 +1025,7 @@ static int esd_usb2_probe_one_net(struct usb_interface *intf, int index)
        netdev->netdev_ops = &esd_usb2_netdev_ops;
 
        SET_NETDEV_DEV(netdev, &intf->dev);
+       netdev->dev_id = index;
 
        err = register_candev(netdev);
        if (err) {
index e77d110..4ca46ed 100644 (file)
@@ -1388,6 +1388,7 @@ static const struct net_device_ops kvaser_usb_netdev_ops = {
        .ndo_open = kvaser_usb_open,
        .ndo_stop = kvaser_usb_close,
        .ndo_start_xmit = kvaser_usb_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 static const struct can_bittiming_const kvaser_usb_bittiming_const = {
@@ -1529,6 +1530,7 @@ static int kvaser_usb_init_one(struct usb_interface *intf,
        netdev->netdev_ops = &kvaser_usb_netdev_ops;
 
        SET_NETDEV_DEV(netdev, &intf->dev);
+       netdev->dev_id = channel;
 
        dev->nets[channel] = priv;
 
index 0b7a4c3..644e6ab 100644 (file)
@@ -702,6 +702,7 @@ static const struct net_device_ops peak_usb_netdev_ops = {
        .ndo_open = peak_usb_ndo_open,
        .ndo_stop = peak_usb_ndo_stop,
        .ndo_start_xmit = peak_usb_ndo_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 /*
@@ -769,6 +770,7 @@ static int peak_usb_create_dev(struct peak_usb_adapter *peak_usb_adapter,
        usb_set_intfdata(intf, dev);
 
        SET_NETDEV_DEV(netdev, &intf->dev);
+       netdev->dev_id = ctrl_idx;
 
        err = register_candev(netdev);
        if (err) {
index a0fa1fd..cde2634 100644 (file)
@@ -887,6 +887,7 @@ static const struct net_device_ops usb_8dev_netdev_ops = {
        .ndo_open = usb_8dev_open,
        .ndo_stop = usb_8dev_close,
        .ndo_start_xmit = usb_8dev_start_xmit,
+       .ndo_change_mtu = can_change_mtu,
 };
 
 static const struct can_bittiming_const usb_8dev_bittiming_const = {