Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2417013imm; Thu, 27 Sep 2018 12:30:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV62duTtZCcxV5QA4+yQnDuakUHREhOfENXwe7CuMB1oj4OL1PB6JKl0s5dPWvC0Q93nrb5ZB X-Received: by 2002:a17:902:5e3:: with SMTP id f90-v6mr12452931plf.222.1538076623832; Thu, 27 Sep 2018 12:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538076623; cv=none; d=google.com; s=arc-20160816; b=sURGMDjE0ZcUNFz07+4cqt0fNpONOG7LYHUHqpKDoZOEnKTGz5ITdCVrafCF5+6vll 2N93FE/7Am00ZNQ1DBLmSmT4cYfqKRT58bKjVQ1mD5mz87/06C7SEEVBTlwmyI1nNd7s 3tv/djB8GSU2JMkFzlsOaO4NtCb4Lni6VqlW0Xe8Cbm2cICO1pMHEI31dTlcS4BEsicN knUepp6xXOM9KU/G9CiBn9tpKnhNLvPKzGxDsQ69DdDc2TRh3pNzt1Dljo7yq+rxE+tc ESYxggn/PBWqtwC/3/1VelB1/iBHfsrePhBWbX6B3ZSCkr18T2I101/NIIEmwCLr5QRq GDQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=BR3XdpM77bkzeCA1nOWdFvnsFxJuS1RUJqU6EBdaw28=; b=0B2Lp8wZiycDZUidlMQwc2FoDKezFHhNWr6NFaUkmfUfD30Ys57hkj/R8twLxy0LvF 3hJIdjRVYjchW8TqeYDruD8qcynsyh7ss63gLcA5HB8ilLkt58Z4ETob370FSLtYjjDY hnVlIM8zZ5urrIkXrWt3byca9DAoWcsOyhvLuwUovqEBOKHWLf0wLs2fmt+Eh4sjEYqA k5M5nyUUlHGqQeQdBfVGe05xRN4hVroE8COzPknSozh91nVVnZFtLGieCyHZchUe4isG 5HR74ZNx/LpLce8Kx5lOrOXuxci6vcA54+r9OrkcuoIxRs6TdaNwHJx6xzjkDo7FaeMZ KZeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72-v6si2773688ple.354.2018.09.27.12.30.07; Thu, 27 Sep 2018 12:30:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728819AbeI1BtE (ORCPT + 99 others); Thu, 27 Sep 2018 21:49:04 -0400 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:59426 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728278AbeI1BtE (ORCPT ); Thu, 27 Sep 2018 21:49:04 -0400 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2001:1bc8:1a6:d3d5::80:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id 8AE10634C7E; Thu, 27 Sep 2018 22:29:13 +0300 (EEST) Received: from sakke by valkosipuli.localdomain with local (Exim 4.89) (envelope-from ) id 1g5byL-0000Eg-9Z; Thu, 27 Sep 2018 22:29:13 +0300 Date: Thu, 27 Sep 2018 22:29:13 +0300 From: Sakari Ailus To: Ricardo Ribalda Delgado Cc: Pavel Machek , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Verkuil , Laurent Pinchart Subject: Re: [PATCH v4 4/7] [media] ad5820: Add support for of-autoload Message-ID: <20180927192912.hecig4ybp2jnh4ou@valkosipuli.retiisi.org.uk> References: <20180920204751.29117-1-ricardo.ribalda@gmail.com> <20180920204751.29117-4-ricardo.ribalda@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180920204751.29117-4-ricardo.ribalda@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ricardo, On Thu, Sep 20, 2018 at 10:47:48PM +0200, Ricardo Ribalda Delgado wrote: > Since kernel 4.16, i2c devices with DT compatible tag are modprobed > using their DT modalias. > Without this patch, if this driver is build as module it would never > be autoprobed. > > Signed-off-by: Ricardo Ribalda Delgado > Acked-by: Pavel Machek > --- > drivers/media/i2c/ad5820.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/media/i2c/ad5820.c b/drivers/media/i2c/ad5820.c > index 625867472929..e461d36201a4 100644 > --- a/drivers/media/i2c/ad5820.c > +++ b/drivers/media/i2c/ad5820.c > @@ -372,12 +372,21 @@ static const struct i2c_device_id ad5820_id_table[] = { > }; > MODULE_DEVICE_TABLE(i2c, ad5820_id_table); > > +#ifdef CONFIG_OF > +static const struct of_device_id ad5820_of_table[] = { > + { .compatible = "adi,ad5820" }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, ad5820_of_table); > +#endif > + > static SIMPLE_DEV_PM_OPS(ad5820_pm, ad5820_suspend, ad5820_resume); > > static struct i2c_driver ad5820_i2c_driver = { > .driver = { > .name = AD5820_NAME, > .pm = &ad5820_pm, > + .of_match_table = of_match_ptr(ad5820_of_table), No need to use of_match_ptr() or #ifdef above --- not doing so makes this work on ACPI, too. > }, > .probe = ad5820_probe, > .remove = ad5820_remove, -- Regards, Sakari Ailus e-mail: sakari.ailus@iki.fi