From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Subject: Re: [PATCHv2] adp1653: make ->power() method optional
Date: Thu, 18 Aug 2011 14:32:02 +0300 [thread overview]
Message-ID: <1313667122.25065.8.camel@smile> (raw)
In-Reply-To: <98c77ce2a17d7a098dedfc858f4055edc5556c54.1313666504.git.andriy.shevchenko@linux.intel.com>
On Thu, 2011-08-18 at 14:22 +0300, Andy Shevchenko wrote:
> The ->power() could be absent or not used on some platforms. This patch makes
> its presence optional.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Sakari Ailus <sakari.ailus@iki.fi>
> ---
> drivers/media/video/adp1653.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c
> index 0fd9579..f830313 100644
> --- a/drivers/media/video/adp1653.c
> +++ b/drivers/media/video/adp1653.c
> @@ -329,6 +329,11 @@ adp1653_set_power(struct v4l2_subdev *subdev, int on)
> struct adp1653_flash *flash = to_adp1653_flash(subdev);
> int ret = 0;
>
> + /* There is no need to switch power in case of absence ->power()
> + * method. */
> + if (flash->platform_data->power == NULL)
> + return 0;
> +
> mutex_lock(&flash->power_lock);
>
> /* If the power count is modified from 0 to != 0 or from != 0 to 0,
He-h, I guess you are not going to apply this one.
The patch breaks init logic of the device. If we have no ->power(), we
still need to bring the device to the known state. I have no good idea
how to do this.
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2011-08-18 11:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-18 8:53 [PATCH] adp1653: make ->power() method optional Andy Shevchenko
2011-08-18 9:21 ` Sakari Ailus
2011-08-18 10:30 ` Andy Shevchenko
2011-08-18 10:53 ` Sakari Ailus
2011-08-18 11:00 ` Andy Shevchenko
2011-08-18 11:22 ` [PATCHv2] " Andy Shevchenko
2011-08-18 11:32 ` Andy Shevchenko [this message]
2011-08-18 11:51 ` Sakari Ailus
2011-08-18 13:32 ` Andy Shevchenko
2011-08-18 13:55 ` Sakari Ailus
2011-08-18 14:08 ` Sakari Ailus
2011-08-18 17:13 ` Sylwester Nawrocki
2011-08-18 19:02 ` Sakari Ailus
2011-08-18 20:59 ` Sylwester Nawrocki
2011-08-19 16:16 ` Sakari Ailus
2011-08-19 20:24 ` Sakari Ailus
2011-08-19 20:30 ` Sylwester Nawrocki
2011-09-06 13:09 ` Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1313667122.25065.8.camel@smile \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox