* [PATCH] staging: iio: io-trig-bfin-timer: use dev_get_platdata()
@ 2016-03-14 6:15 Alison Schofield
2016-03-14 9:56 ` [Outreachy kernel] " Daniel Baluta
0 siblings, 1 reply; 2+ messages in thread
From: Alison Schofield @ 2016-03-14 6:15 UTC (permalink / raw)
To: outreachy-kernel
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>
---
drivers/staging/iio/trigger/iio-trig-bfin-timer.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
index 035dd45..8667334 100644
--- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
+++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [Outreachy kernel] [PATCH] staging: iio: io-trig-bfin-timer: use dev_get_platdata()
2016-03-14 6:15 [PATCH] staging: iio: io-trig-bfin-timer: use dev_get_platdata() Alison Schofield
@ 2016-03-14 9:56 ` Daniel Baluta
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Baluta @ 2016-03-14 9:56 UTC (permalink / raw)
To: Alison Schofield; +Cc: outreachy-kernel
On Mon, Mar 14, 2016 at 8:15 AM, Alison Schofield <amsfield22@gmail.com> wrote:
> 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>
> ---
> drivers/staging/iio/trigger/iio-trig-bfin-timer.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
> index 035dd45..8667334 100644
> --- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
> +++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
> @@ -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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-14 9:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-14 6:15 [PATCH] staging: iio: io-trig-bfin-timer: use dev_get_platdata() Alison Schofield
2016-03-14 9:56 ` [Outreachy kernel] " Daniel Baluta
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.