Skip to contentSkip to conversation

staging: iio: io-trig-bfin-timer: use dev_get_platdata()

PATCH In review Alison Schofield 2 participants 2 messages Mar 14, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: iio: io-trig-bfin-timer: use dev_get_platdata()

Use dev_get_platdata() for retrieving the platform data instead of accessing dev->platform_data directly. Move the assignment out of the declaration (avoid lines over 80 char and put it close to usage).

---
 drivers/staging/iio/trigger/iio-trig-bfin-timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/iio/trigger/iio-trig-bfin-timer.c +2 -1
index 035dd45..8667334 100644
@@ -178,7 +178,7 @@ static const struct iio_trigger_ops iio_bfin_tmr_trigger_ops = {
 
 static int iio_bfin_tmr_trigger_probe(struct platform_device *pdev)
 {
-	struct iio_bfin_timer_trigger_pdata *pdata = pdev->dev.platform_data;
+	struct iio_bfin_timer_trigger_pdata *pdata;
 	struct bfin_tmr_state *st;
 	unsigned int config;
 	int ret;
@@ -221,6 +221,7 @@ static int iio_bfin_tmr_trigger_probe(struct platform_device *pdev)
 
 	config = PWM_OUT | PERIOD_CNT | IRQ_ENA;
 
+	pdata =	dev_get_platdata(&pdev->dev);
 	if (pdata && pdata->output_enable) {
 		unsigned long long val;
 
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Alison Schofield

Use dev_get_platdata() for retrieving the platform data instead of accessing dev->platform_data directly. Move the assignment out of the declaration (avoid lines over 80 char and put it close to usage).

Quoted 34 lines
---
 drivers/staging/iio/trigger/iio-trig-bfin-timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/iio/trigger/iio-trig-bfin-timer.c +2 -2
index 035dd45..8667334 100644
@@ -178,7 +178,7 @@ static const struct iio_trigger_ops iio_bfin_tmr_trigger_ops = {
 
 static int iio_bfin_tmr_trigger_probe(struct platform_device *pdev)
 {
-       struct iio_bfin_timer_trigger_pdata *pdata = pdev->dev.platform_data;
+       struct iio_bfin_timer_trigger_pdata *pdata;
        struct bfin_tmr_state *st;
        unsigned int config;
        int ret;
@@ -221,6 +221,7 @@ static int iio_bfin_tmr_trigger_probe(struct platform_device *pdev)
 
        config = PWM_OUT | PERIOD_CNT | IRQ_ENA;
 
+       pdata = dev_get_platdata(&pdev->dev);
        if (pdata && pdata->output_enable) {
                unsigned long long val;
 
--

2.1.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160314061544.GA6641%40d830.WORKGROUP.
For more options, visit https://groups.google.com/d/optout.