From 08c6d35154069becb01243176fb72b3bc60ff3cb Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Wed, 5 Mar 2014 19:10:44 +0100 Subject: can: flexcan: Remove #ifdef CONFIG_PM_SLEEP This patch removes #ifdef CONFIG_PM_SLEEP to improve compile coverage. Signed-off-by: Marc Kleine-Budde --- drivers/net/can/flexcan.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/net/can/flexcan.c') diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 61376abdab39..efa1bbc9a1ec 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -1201,8 +1201,7 @@ static int flexcan_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int flexcan_suspend(struct device *device) +static int __maybe_unused flexcan_suspend(struct device *device) { struct net_device *dev = dev_get_drvdata(device); struct flexcan_priv *priv = netdev_priv(dev); @@ -1221,7 +1220,7 @@ static int flexcan_suspend(struct device *device) return 0; } -static int flexcan_resume(struct device *device) +static int __maybe_unused flexcan_resume(struct device *device) { struct net_device *dev = dev_get_drvdata(device); struct flexcan_priv *priv = netdev_priv(dev); @@ -1233,7 +1232,6 @@ static int flexcan_resume(struct device *device) } return flexcan_chip_enable(priv); } -#endif /* CONFIG_PM_SLEEP */ static SIMPLE_DEV_PM_OPS(flexcan_pm_ops, flexcan_suspend, flexcan_resume); -- cgit v1.2.3 From d0873e6fc06686cf2dfb9adabb6ca65e9967c60f Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Tue, 4 Mar 2014 22:04:22 +0100 Subject: can: flexcan: make use of platform_get_device_id() This patch replaces an open coded pdev->id_entry by platform_get_device_id(). Signed-off-by: Marc Kleine-Budde --- drivers/net/can/flexcan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/net/can/flexcan.c') diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index efa1bbc9a1ec..c94d698b73c2 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -1132,9 +1132,9 @@ static int flexcan_probe(struct platform_device *pdev) of_id = of_match_device(flexcan_of_match, &pdev->dev); if (of_id) { devtype_data = of_id->data; - } else if (pdev->id_entry->driver_data) { + } else if (platform_get_device_id(pdev)->driver_data) { devtype_data = (struct flexcan_devtype_data *) - pdev->id_entry->driver_data; + platform_get_device_id(pdev)->driver_data; } else { return -ENODEV; } -- cgit v1.2.3 From c971fa2ae42e73e9ccc2f5e93f268c8742da4c5d Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Fri, 7 Mar 2014 09:23:41 +0100 Subject: can: Unify MTU settings for CAN interfaces CAN interfaces only support MTU values of 16 (CAN 2.0) and 72 (CAN FD). Setting the MTU to other values is pointless but it does not really hurt. With the introduction of the CAN FD support in drivers/net/can a new function to switch the MTU for CAN FD has been introduced. This patch makes use of this can_change_mtu() function to check for correct MTU settings also in legacy CAN (2.0) devices. Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde --- drivers/net/can/flexcan.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/can/flexcan.c') diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index c94d698b73c2..f425ec2c7839 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -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) -- cgit v1.2.3