staging: iio: io-trig-bfin-timer: use dev_get_platdata()
authorAlison Schofield <amsfield22@gmail.com>
Mon, 14 Mar 2016 06:15:51 +0000 (23:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
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).

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/trigger/iio-trig-bfin-timer.c

index 035dd456d7d67e085db527e10cefad20216f5fc1..8667334f3f4103bf94678a59f807a19924dd5b6c 100644 (file)
@@ -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;