|
@@ -37,7 +37,6 @@
|
|
|
#include <linux/of.h>
|
|
|
#include <linux/of_device.h>
|
|
|
#include <linux/platform_device.h>
|
|
|
-#include <linux/pinctrl/consumer.h>
|
|
|
|
|
|
#define DRV_NAME "flexcan"
|
|
|
|
|
@@ -1004,16 +1003,11 @@ static int flexcan_probe(struct platform_device *pdev)
|
|
|
struct flexcan_priv *priv;
|
|
|
struct resource *mem;
|
|
|
struct clk *clk_ipg = NULL, *clk_per = NULL;
|
|
|
- struct pinctrl *pinctrl;
|
|
|
void __iomem *base;
|
|
|
resource_size_t mem_size;
|
|
|
int err, irq;
|
|
|
u32 clock_freq = 0;
|
|
|
|
|
|
- pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
|
|
|
- if (IS_ERR(pinctrl))
|
|
|
- return PTR_ERR(pinctrl);
|
|
|
-
|
|
|
if (pdev->dev.of_node)
|
|
|
of_property_read_u32(pdev->dev.of_node,
|
|
|
"clock-frequency", &clock_freq);
|
|
@@ -1137,10 +1131,10 @@ static int flexcan_remove(struct platform_device *pdev)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-#ifdef CONFIG_PM
|
|
|
-static int flexcan_suspend(struct platform_device *pdev, pm_message_t state)
|
|
|
+#ifdef CONFIG_PM_SLEEP
|
|
|
+static int flexcan_suspend(struct device *device)
|
|
|
{
|
|
|
- struct net_device *dev = platform_get_drvdata(pdev);
|
|
|
+ struct net_device *dev = dev_get_drvdata(device);
|
|
|
struct flexcan_priv *priv = netdev_priv(dev);
|
|
|
|
|
|
flexcan_chip_disable(priv);
|
|
@@ -1154,9 +1148,9 @@ static int flexcan_suspend(struct platform_device *pdev, pm_message_t state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int flexcan_resume(struct platform_device *pdev)
|
|
|
+static int flexcan_resume(struct device *device)
|
|
|
{
|
|
|
- struct net_device *dev = platform_get_drvdata(pdev);
|
|
|
+ struct net_device *dev = dev_get_drvdata(device);
|
|
|
struct flexcan_priv *priv = netdev_priv(dev);
|
|
|
|
|
|
priv->can.state = CAN_STATE_ERROR_ACTIVE;
|
|
@@ -1168,21 +1162,19 @@ static int flexcan_resume(struct platform_device *pdev)
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
-#else
|
|
|
-#define flexcan_suspend NULL
|
|
|
-#define flexcan_resume NULL
|
|
|
-#endif
|
|
|
+#endif /* CONFIG_PM_SLEEP */
|
|
|
+
|
|
|
+static SIMPLE_DEV_PM_OPS(flexcan_pm_ops, flexcan_suspend, flexcan_resume);
|
|
|
|
|
|
static struct platform_driver flexcan_driver = {
|
|
|
.driver = {
|
|
|
.name = DRV_NAME,
|
|
|
.owner = THIS_MODULE,
|
|
|
+ .pm = &flexcan_pm_ops,
|
|
|
.of_match_table = flexcan_of_match,
|
|
|
},
|
|
|
.probe = flexcan_probe,
|
|
|
.remove = flexcan_remove,
|
|
|
- .suspend = flexcan_suspend,
|
|
|
- .resume = flexcan_resume,
|
|
|
.id_table = flexcan_id_table,
|
|
|
};
|
|
|
|