Skip to contentSkip to conversation

can: use dev_get_platdata()

PATCH In review Jingoo Han 2 participants 11 messages Sep 10, 2013

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

cover can: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability.

---
 drivers/net/can/at91_can.c                 |    2 +-
 drivers/net/can/bfin_can.c                 |    2 +-
 drivers/net/can/cc770/cc770_platform.c     |    4 ++--
 drivers/net/can/flexcan.c                  |    2 +-
 drivers/net/can/janz-ican3.c               |    2 +-
 drivers/net/can/mcp251x.c                  |    2 +-
 drivers/net/can/sja1000/sja1000_platform.c |    2 +-
 drivers/net/can/softing/softing_main.c     |    2 +-
 drivers/net/can/ti_hecc.c                  |    2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)
author
#1 lore raw

PATCH 1/9 can: at91_can: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability.

---
 drivers/net/can/at91_can.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/at91_can.c +1 -1
index 3b1ff61..64f2efa 100644
@@ -1347,7 +1347,7 @@ static int at91_can_probe(struct platform_device *pdev)
 	priv->reg_base = addr;
 	priv->devtype_data = *devtype_data;
 	priv->clk = clk;
-	priv->pdata = pdev->dev.platform_data;
+	priv->pdata = dev_get_platdata(&pdev->dev);
 	priv->mb0_id = 0x7ff;
 
 	netif_napi_add(dev, &priv->napi, at91_poll, get_mb_rx_num(priv));
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 2/9 can: bfin_can: use dev_get_platdata()

In reply to Jingoo Han

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability.

---
 drivers/net/can/bfin_can.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/bfin_can.c +1 -1
index a2700d2..8a0b515 100644
@@ -539,7 +539,7 @@ static int bfin_can_probe(struct platform_device *pdev)
 	struct resource *res_mem, *rx_irq, *tx_irq, *err_irq;
 	unsigned short *pdata;
 
-	pdata = pdev->dev.platform_data;
+	pdata = dev_get_platdata(&pdev->dev);
 	if (!pdata) {
 		dev_err(&pdev->dev, "No platform data provided!\n");
 		err = -EINVAL;
Signature · 1 line
1.7.10.4
author
#3 lore raw

PATCH 3/9 can: cc770: use dev_get_platdata()

In reply to Jingoo Han

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability.

---
 drivers/net/can/cc770/cc770_platform.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/cc770/cc770_platform.c +2 -2
index 034bdd8..ad76734 100644
@@ -152,7 +152,7 @@ static int cc770_get_platform_data(struct platform_device *pdev,
 				   struct cc770_priv *priv)
 {
 
-	struct cc770_platform_data *pdata = pdev->dev.platform_data;
+	struct cc770_platform_data *pdata = dev_get_platdata(&pdev->dev);
 
 	priv->can.clock.freq = pdata->osc_freq;
 	if (priv->cpu_interface & CPUIF_DSC)
@@ -203,7 +203,7 @@ static int cc770_platform_probe(struct platform_device *pdev)
 
 	if (pdev->dev.of_node)
 		err = cc770_get_of_node_data(pdev, priv);
-	else if (pdev->dev.platform_data)
+	else if (dev_get_platdata(&pdev->dev))
 		err = cc770_get_platform_data(pdev, priv);
 	else
 		err = -ENODEV;
Signature · 1 line
1.7.10.4
author
#4 lore raw

PATCH 4/9 can: flexcan: use dev_get_platdata()

In reply to Jingoo Han

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability.

---
 drivers/net/can/flexcan.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/flexcan.c +1 -1
index 71c677e..e8c46bd 100644
@@ -1074,7 +1074,7 @@ static int flexcan_probe(struct platform_device *pdev)
 	priv->dev = dev;
 	priv->clk_ipg = clk_ipg;
 	priv->clk_per = clk_per;
-	priv->pdata = pdev->dev.platform_data;
+	priv->pdata = dev_get_platdata(&pdev->dev);
 	priv->devtype_data = devtype_data;
 
 	priv->reg_xceiver = devm_regulator_get(&pdev->dev, "xceiver");
Signature · 1 line
1.7.10.4
author
#5 lore raw

PATCH 5/9 can: janz-ican3: use dev_get_platdata()

In reply to Jingoo Han

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability.

---
 drivers/net/can/janz-ican3.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/janz-ican3.c +1 -1
index 36bd6fa..ab5909a 100644
@@ -1769,7 +1769,7 @@ static int ican3_probe(struct platform_device *pdev)
 	struct device *dev;
 	int ret;
 
-	pdata = pdev->dev.platform_data;
+	pdata = dev_get_platdata(&pdev->dev);
 	if (!pdata)
 		return -ENXIO;
 
Signature · 1 line
1.7.10.4
author
#6 lore raw

PATCH 6/9 can: mcp251x: use dev_get_platdata()

In reply to Jingoo Han

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability.

---
 drivers/net/can/mcp251x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/mcp251x.c +1 -1
index fe7dd69..08ac401 100644
@@ -999,7 +999,7 @@ static int mcp251x_can_probe(struct spi_device *spi)
 {
 	struct net_device *net;
 	struct mcp251x_priv *priv;
-	struct mcp251x_platform_data *pdata = spi->dev.platform_data;
+	struct mcp251x_platform_data *pdata = dev_get_platdata(&spi->dev);
 	int ret = -ENODEV;
 
 	if (!pdata)
Signature · 1 line
1.7.10.4
author
#7 lore raw

PATCH 7/9 can: sja1000: use dev_get_platdata()

In reply to Jingoo Han

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability.

---
 drivers/net/can/sja1000/sja1000_platform.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/sja1000/sja1000_platform.c +1 -1
index 8e259c5..29f9b63 100644
@@ -76,7 +76,7 @@ static int sp_probe(struct platform_device *pdev)
 	struct resource *res_mem, *res_irq;
 	struct sja1000_platform_data *pdata;
 
-	pdata = pdev->dev.platform_data;
+	pdata = dev_get_platdata(&pdev->dev);
 	if (!pdata) {
 		dev_err(&pdev->dev, "No platform data provided!\n");
 		err = -ENODEV;
Signature · 1 line
1.7.10.4
author
#8 lore raw

PATCH 8/9 can: softing: use dev_get_platdata()

In reply to Jingoo Han

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability.

---
 drivers/net/can/softing/softing_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/softing/softing_main.c +1 -1
index 65eef1e..6cd5c01 100644
@@ -768,7 +768,7 @@ static int softing_pdev_remove(struct platform_device *pdev)
 
 static int softing_pdev_probe(struct platform_device *pdev)
 {
-	const struct softing_platform_data *pdat = pdev->dev.platform_data;
+	const struct softing_platform_data *pdat = dev_get_platdata(&pdev->dev);
 	struct softing *card;
 	struct net_device *netdev;
 	struct softing_priv *priv;
Signature · 1 line
1.7.10.4
author
#9 lore raw

PATCH 9/9 can: ti_hecc: use dev_get_platdata()

In reply to Jingoo Han

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability.

---
 drivers/net/can/ti_hecc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/ti_hecc.c +1 -1
index 3a349a2..beb5ef8 100644
@@ -894,7 +894,7 @@ static int ti_hecc_probe(struct platform_device *pdev)
 	void __iomem *addr;
 	int err = -ENODEV;
 
-	pdata = pdev->dev.platform_data;
+	pdata = dev_get_platdata(&pdev->dev);
 	if (!pdata) {
 		dev_err(&pdev->dev, "No platform data\n");
 		goto probe_exit;
Signature · 1 line
1.7.10.4
#10 lore raw
In reply to Jingoo Han
Quoted 3 lines · Jingoo Han

Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability.

Tnx, all applied to net-next/testing. The series will be included in the next pull request to David Miller.

regards,
Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |