staging: iio: io-trig-bfin-timer: use dev_get_platdata()
Subsystems (3)
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
@@ -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
Quoted 6 lines · Alison Schofield
Use
dev_get_platdata()for retrieving the platform data instead of accessingdev->platform_datadirectly. Move the assignment out of the declaration (avoid lines over 80 char and put it close to usage).Signed-off-by Alison Schofield <[email protected]>
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@@ -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.