Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750974AbdL3Mnm (ORCPT ); Sat, 30 Dec 2017 07:43:42 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:41058 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbdL3Mnk (ORCPT ); Sat, 30 Dec 2017 07:43:40 -0500 X-Google-Smtp-Source: ACJfBouFCeWoA2xV++uiARAAkqslq1j7fLg7jPeIabl5E0NXE+XItCRLoZFFe7C8TdbRT6zYCUSJjzyHVACd7ex9bV0= MIME-Version: 1.0 In-Reply-To: <20171229175449.760e734d@archlinux> References: <1514556006-23293-1-git-send-email-mastichi@gmail.com> <20171229175449.760e734d@archlinux> From: Dmitry Mastykin Date: Sat, 30 Dec 2017 15:43:38 +0300 Message-ID: Subject: Re: [PATCH v2] iio: adc: max9611: fix module auto-loading To: Jonathan Cameron Cc: Andy Shevchenko , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jacopo Mondi , Dan Carpenter , Rob Herring , linux-iio@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1802 Lines: 48 > On Fri, 29 Dec 2017 17:30:39 +0200 > Andy Shevchenko wrote: >> Suggested-by: Andy Shevchenko >> I was not aware of this tag, that's what I wanted to write, thanks! On Fri, Dec 29, 2017 at 8:54 PM, Jonathan Cameron wrote: > I'm a little confused. Why does this now make module autoloading > work where it previously didn't? > As I understand, .probe is not called if module doesn't export i2c id table, there is nothing to put into second argument. But .probe_new is called, because it's supposed to do of_match_device itself. Kind regards, Dmitry >> > Signed-off-by: Dmitry Mastykin >> > --- >> > drivers/iio/adc/max9611.c | 5 ++--- >> > 1 file changed, 2 insertions(+), 3 deletions(-) >> > >> > diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c >> > index b1dd17c..ce0115a 100644 >> > --- a/drivers/iio/adc/max9611.c >> > +++ b/drivers/iio/adc/max9611.c >> > @@ -523,8 +523,7 @@ static const struct of_device_id max9611_of_table[] = { >> > }; >> > >> > MODULE_DEVICE_TABLE(of, max9611_of_table); >> > -static int max9611_probe(struct i2c_client *client, >> > - const struct i2c_device_id *id) >> > +static int max9611_probe(struct i2c_client *client) >> > { >> > const char * const shunt_res_prop = "shunt-resistor-micro-ohms"; >> > const struct device_node *of_node = client->dev.of_node; >> > @@ -576,7 +575,7 @@ static struct i2c_driver max9611_driver = { >> > .owner = THIS_MODULE, >> > .of_match_table = max9611_of_table, >> > }, >> > - .probe = max9611_probe, >> > + .probe_new = max9611_probe, >> > }; >> > module_i2c_driver(max9611_driver); >> > >> > -- >> > 2.7.4 >> >