From patchwork Thu Aug 18 08:53:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 1075892 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7I8ojQX019473 for ; Thu, 18 Aug 2011 08:53:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755220Ab1HRIxc (ORCPT ); Thu, 18 Aug 2011 04:53:32 -0400 Received: from mga11.intel.com ([192.55.52.93]:25278 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755139Ab1HRIxb (ORCPT ); Thu, 18 Aug 2011 04:53:31 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 18 Aug 2011 01:53:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.68,244,1312182000"; d="scan'208";a="41018980" Received: from unknown (HELO smile) ([10.255.18.60]) by fmsmga002.fm.intel.com with ESMTP; 18 Aug 2011 01:53:30 -0700 Received: from andy by smile with local (Exim 4.76) (envelope-from ) id 1QtyLk-0006VJ-RV; Thu, 18 Aug 2011 11:53:16 +0300 From: Andy Shevchenko To: linux-media@vger.kernel.org Cc: Andy Shevchenko , Sakari Ailus Subject: [PATCH] adp1653: make ->power() method optional Date: Thu, 18 Aug 2011 11:53:03 +0300 Message-Id: X-Mailer: git-send-email 1.7.5.4 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 (demeter2.kernel.org [140.211.167.43]); Thu, 18 Aug 2011 08:53:33 +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 | 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;