From patchwork Thu Aug 18 11:22:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 1076112 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7IBMwOd020978 for ; Thu, 18 Aug 2011 11:22:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755577Ab1HRLW4 (ORCPT ); Thu, 18 Aug 2011 07:22:56 -0400 Received: from mga11.intel.com ([192.55.52.93]:17066 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755194Ab1HRLW4 (ORCPT ); Thu, 18 Aug 2011 07:22:56 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 18 Aug 2011 04:22:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.68,244,1312182000"; d="scan'208";a="42644176" Received: from unknown (HELO smile) ([10.255.18.60]) by fmsmga001.fm.intel.com with ESMTP; 18 Aug 2011 04:22:54 -0700 Received: from andy by smile with local (Exim 4.76) (envelope-from ) id 1Qu0gL-0002kS-E5; Thu, 18 Aug 2011 14:22:41 +0300 From: Andy Shevchenko To: linux-media@vger.kernel.org Cc: Andy Shevchenko , Sakari Ailus Subject: [PATCHv2] adp1653: make ->power() method optional Date: Thu, 18 Aug 2011 14:22:27 +0300 Message-Id: <98c77ce2a17d7a098dedfc858f4055edc5556c54.1313666504.git.andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <20110818092158.GA8872@valkosipuli.localdomain> References: <20110818092158.GA8872@valkosipuli.localdomain> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 18 Aug 2011 11:22:58 +0000 (UTC) The ->power() could be absent or not used on some platforms. This patch makes its presence optional. Signed-off-by: Andy Shevchenko Cc: Sakari Ailus --- 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,