From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40416C433DF for ; Mon, 15 Jun 2020 11:22:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23AF620663 for ; Mon, 15 Jun 2020 11:22:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729673AbgFOLWz (ORCPT ); Mon, 15 Jun 2020 07:22:55 -0400 Received: from mga09.intel.com ([134.134.136.24]:45343 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728285AbgFOLWy (ORCPT ); Mon, 15 Jun 2020 07:22:54 -0400 IronPort-SDR: 93nY3DUYLIo8cofnSTc+WeMrPVDOWV32OqQD7hu7j922TLXD0RW31F2oKCoJ20VpQflEn9EH1c 7WSvsByD0V7g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2020 04:22:53 -0700 IronPort-SDR: ij5iitFXCB3O9mBJdw1gRYwX/Rxy1J59rJ4+Cy9NErBv9rJqb95vLxkZ65v8beqqBx5ZI1kB0f 9L+PzMFrJeGg== X-IronPort-AV: E=Sophos;i="5.73,514,1583222400"; d="scan'208";a="261070564" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2020 04:22:52 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id 35393206D6; Mon, 15 Jun 2020 14:22:50 +0300 (EEST) Date: Mon, 15 Jun 2020 14:22:50 +0300 From: Sakari Ailus To: Srinivas Kandagatla Cc: Bingbu Cao , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, bingbu.cao@linux.intel.com Subject: Re: [PATCH] media: ov2740: add NVMEM interface to read customized OTP data Message-ID: <20200615112250.GU16711@paasikivi.fi.intel.com> References: <1591954922-14006-1-git-send-email-bingbu.cao@intel.com> <20200615092923.GT16711@paasikivi.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Srinivas, On Mon, Jun 15, 2020 at 10:46:20AM +0100, Srinivas Kandagatla wrote: > > > On 15/06/2020 10:29, Sakari Ailus wrote: > > > + ret = ov2740_register_nvmem(client); > > > + if (ret) > > > + dev_err(&client->dev, "register nvmem failed, ret %d\n", ret); > > > + > > > /* > > > * Device is already turned on by i2c-core with ACPI domain PM. > > > * Enable runtime PM and turn off the device. > > Could you add #ifdefs for CONFIG_NVMEM so this compiles when it's disabled? > > NVMEM already has dummy functions. IMO its better to report an error to user > as the current code does. This will atleast alert the users of existing > nvmem provider that has been disabled! > > However with ifdef users have to really look into code to be able to > understand that there is nvmem provider as part of this driver. Right, I somehow missed there already were dummy functions for this. The driver is a camera sensor driver that contains an EEPROM. I'd presume that not all (or even many) users would care about the EEPROM content so therefore requiring NVMEM to compile the driver seems unjustified. Therefore the patch is fine as-is IMO. -- Kind regards, Sakari Ailus