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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE4A5ECAAD8 for ; Fri, 16 Sep 2022 21:51:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229749AbiIPVvs (ORCPT ); Fri, 16 Sep 2022 17:51:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbiIPVvs (ORCPT ); Fri, 16 Sep 2022 17:51:48 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43299BA9FC; Fri, 16 Sep 2022 14:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663365107; x=1694901107; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=8c8cWwwOXKYrrI8tz7xN0EBWhqw3oubByMkTEjiFBn8=; b=WR6duLpJydt7lLhVmXVXF5kjSJqunBCfJPouHN7MKFO87p6jjlNouWRM 0X4h5SFBer1Wc2RBylYLlkd3rpOVNfWH4ivtORs6KBVnlPDzBUK6nzXr8 glr3DbUxM37/zpD2wEbzyTSTDiiJ/xObRZLzSeWD5q7tGiLZcoS2sHIAQ 1ZvFu0U9Ygb1Hwndr0bZ/wtROw66t95MtybnwB+vfwM8lGGFqp3LveEsd zo7xbcQhZkJCFBDVg1a5n779sUGXauu3gomHZuwakMXlqNGLtwlp5nSYD AIfJIuslGHgG3+Sun/HnmjAt7rYTEs80vHJrOLcV34KJ4cVxH/h1EGlhf Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10472"; a="299908613" X-IronPort-AV: E=Sophos;i="5.93,321,1654585200"; d="scan'208";a="299908613" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 14:51:46 -0700 X-IronPort-AV: E=Sophos;i="5.93,321,1654585200"; d="scan'208";a="743478235" Received: from punajuuri.fi.intel.com (HELO paasikivi.fi.intel.com) ([10.237.72.43]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 14:51:42 -0700 Received: from paasikivi.fi.intel.com (localhost [127.0.0.1]) by paasikivi.fi.intel.com (Postfix) with SMTP id 810BB2022B; Sat, 17 Sep 2022 00:51:40 +0300 (EEST) Date: Fri, 16 Sep 2022 21:51:40 +0000 From: Sakari Ailus To: Krzysztof Kozlowski Cc: Mikhail Rudenko , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Hans Verkuil , Jacopo Mondi , Shawn Tu , Randy Dunlap , Daniel Scally , Christian Hemp , Laurent Pinchart , Marek Vasut , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] media: i2c: add support for ov4689 Message-ID: References: <20220911200147.375198-1-mike.rudenko@gmail.com> <20220911200147.375198-3-mike.rudenko@gmail.com> <87o7vgpa50.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Krzysztof, Mikhail, On Fri, Sep 16, 2022 at 10:43:11AM +0100, Krzysztof Kozlowski wrote: > On 15/09/2022 21:40, Mikhail Rudenko wrote: > > > > Hi Krzysztof, > > > > On 2022-09-12 at 12:56 +02, Krzysztof Kozlowski wrote: > >> On 11/09/2022 22:01, Mikhail Rudenko wrote: > >>> +static const struct i2c_device_id ov4689_id[] = { > >>> + { "ov4689", 0 }, > >>> + {}, > >>> +}; > >>> +MODULE_DEVICE_TABLE(i2c, ov4689_id); > >>> + > >>> +static const struct of_device_id ov4689_of_match[] = { > >>> + { .compatible = "ovti,ov4689" }, > >>> + {}, > >>> +}; > >>> +MODULE_DEVICE_TABLE(of, ov4689_of_match); > >>> + > >>> +static struct i2c_driver ov4689_i2c_driver = { > >>> + .driver = { > >>> + .name = "ov4689", > >>> + .pm = &ov4689_pm_ops, > >>> + .of_match_table = of_match_ptr(ov4689_of_match), > >> > >> of_match_ptr is usually paired with maybe_unused, otherwise you will > >> have compile test warnings. > > > > I see. I think we could also use `#if IS_ENABLED(CONFIG_OF)` around > > `ov4689_of_match` and the corresponding `MODULE_DEVICE_TABLE`. Is it > > appropriate here? > > Would work, but ifdefs are not nice. Just use maybe_unused. Warnings > should disappear. Neither is needed. Just drop of_match_ptr(). Apart from clock handling, it would probably work on ACPI, too. No need to address that though. -- Regards, Sakari Ailus