All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Sakari Ailus <sakari.ailus@iki.fi>
Subject: [PATCH] adp1653: make ->power() method optional
Date: Thu, 18 Aug 2011 11:53:03 +0300	[thread overview]
Message-ID: <aa45d92c4ec78b36b28eb721ef58f3a5512900a3.1313657559.git.andriy.shevchenko@linux.intel.com> (raw)

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 |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c
index 0fd9579..65f6f3f 100644
--- a/drivers/media/video/adp1653.c
+++ b/drivers/media/video/adp1653.c
@@ -309,6 +309,9 @@ __adp1653_set_power(struct adp1653_flash *flash, int on)
 {
 	int ret;
 
+	if (flash->platform_data->power == NULL)
+		return 0;
+
 	ret = flash->platform_data->power(&flash->subdev, on);
 	if (ret < 0)
 		return ret;
-- 
1.7.5.4


             reply	other threads:[~2011-08-18  8:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-18  8:53 Andy Shevchenko [this message]
2011-08-18  9:21 ` [PATCH] adp1653: make ->power() method optional 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
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=aa45d92c4ec78b36b28eb721ef58f3a5512900a3.1313657559.git.andriy.shevchenko@linux.intel.com \
    --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 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.