Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp62242rwn; Fri, 16 Sep 2022 15:23:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4SEr3U6BJ2F35cM5n1hB5l9qcKpseh3OsZ9qGeP6heDXBespUGT7l0CYGzSQvvqL2yUEaZ X-Received: by 2002:a05:6a00:230d:b0:53d:c198:6ad7 with SMTP id h13-20020a056a00230d00b0053dc1986ad7mr7576417pfh.67.1663367012832; Fri, 16 Sep 2022 15:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663367012; cv=none; d=google.com; s=arc-20160816; b=DgHE4FISWg/43Im9qtPGj2SB+9VfhqBUKsz7o8Bml3/TIp14SPYlp52xXhEEmF17iD e+/OFG1p/u7zbN9T1IllTvc5CSUoCa8qn7VSrIwgkopxrmGuDhJP9zvSy0WyaX3PcAxW bncfi7BXaUWXRzGRNHxBKDS+U7HNJJmXoNNW19C0hFGLkU/JKOySwtrBvziLsIsGG3BW PyvrYOG8Ur/d0G0UFPucfaZjvgCWuPrZ3V9x0ZhI5QwZMrEqR9nnQwyb2vS3/OjoftI+ y0TmaaNpKgsA+0SGBNjnI52nVrVGX8jaCNil0RReFyrqXn5qrkh0Kk8IIVrvv/7AXTLJ VT3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=VfZcf9c0tfbSahB+Qjabs8HvkSV/7uEtrftllH043Lk=; b=e6SZNF62jKFJ5ZoQvKAUEjuNxvkZiqjDVepfG+KWj9JvvARUlryQKNin2Pz9PS+8Hx BokkfliUqKGFxB4Lm/IBkjbzOiDcpLKauG31QJMnMVqMnyK93DyeU6wjt8t9aXsvHPLg MoVNphto9NYYJ3vUWS8FYxFvwM0ni3p7xw3iBgkLW16BolRTRDCEyTks0dt48kCJXw5/ iol1NAT4sj/Q6rMk5DbeemB7lNGsqpMS3Ttj5kXv/RpUxAYjI9jlngp+7IABSVv/G2Ux Bd18H//VKZzTARFlJgrSJrKh4pokSBmhG0iTBZSSHZgQfTFW5CB79M7Mqiy662BNkXfR DiRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WR6duLpJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw2-20020a17090b180200b001fdd4a9fd3fsi4294292pjb.146.2022.09.16.15.23.08; Fri, 16 Sep 2022 15:23:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WR6duLpJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229913AbiIPVvu (ORCPT + 99 others); Fri, 16 Sep 2022 17:51:50 -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: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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