rtc: i2c/spi: Avoid inclusion of REGMAP support when not needed
diff mbox series

Message ID 20200112171349.22268-1-geert@linux-m68k.org
State Accepted
Headers show
Series
  • rtc: i2c/spi: Avoid inclusion of REGMAP support when not needed
Related show

Commit Message

Geert Uytterhoeven Jan. 12, 2020, 5:13 p.m. UTC
Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when
no driver needs it.  While the former can be moduler, the latter cannot,
and thus becomes built-in.

Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI
from the RTC_I2C_AND_SPI helper to the individual drivers that depend on
it.

Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI
for more information, but the latter does not select REGMAP_{I2C,SPI}
itself, and defers that to the individual drivers, too.

Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Joe: When merging addresses, scripts/get_maintainer.pl replaces
     Alexandre's authoritative email address from MAINTAINERS by the
     obsolete address in the SoB-line of the commit referred to by the
     Fixes-line.

 drivers/rtc/Kconfig | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

kbuild test robot Jan. 12, 2020, 9:45 p.m. UTC | #1
Hi Geert,

I love your patch! Yet something to improve:

[auto build test ERROR on abelloni/rtc-next]
[also build test ERROR on v5.5-rc5 next-20200110]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Geert-Uytterhoeven/rtc-i2c-spi-Avoid-inclusion-of-REGMAP-support-when-not-needed/20200113-013332
base:   https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

>> drivers/rtc/rtc-ds1307.c:1570:21: error: variable 'regmap_config' has initializer but incomplete type
    static const struct regmap_config regmap_config = {
                        ^~~~~~~~~~~~~
>> drivers/rtc/rtc-ds1307.c:1571:3: error: 'const struct regmap_config' has no member named 'reg_bits'
     .reg_bits = 8,
      ^~~~~~~~
>> drivers/rtc/rtc-ds1307.c:1571:14: warning: excess elements in struct initializer
     .reg_bits = 8,
                 ^
   drivers/rtc/rtc-ds1307.c:1571:14: note: (near initialization for 'regmap_config')
>> drivers/rtc/rtc-ds1307.c:1572:3: error: 'const struct regmap_config' has no member named 'val_bits'
     .val_bits = 8,
      ^~~~~~~~
   drivers/rtc/rtc-ds1307.c:1572:14: warning: excess elements in struct initializer
     .val_bits = 8,
                 ^
   drivers/rtc/rtc-ds1307.c:1572:14: note: (near initialization for 'regmap_config')
   drivers/rtc/rtc-ds1307.c: In function 'ds1307_probe':
>> drivers/rtc/rtc-ds1307.c:1596:19: error: implicit declaration of function 'devm_regmap_init_i2c'; did you mean 'devm_request_irq'? [-Werror=implicit-function-declaration]
     ds1307->regmap = devm_regmap_init_i2c(client, &regmap_config);
                      ^~~~~~~~~~~~~~~~~~~~
                      devm_request_irq
>> drivers/rtc/rtc-ds1307.c:1596:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     ds1307->regmap = devm_regmap_init_i2c(client, &regmap_config);
                    ^
   drivers/rtc/rtc-ds1307.c: At top level:
>> drivers/rtc/rtc-ds1307.c:1570:35: error: storage size of 'regmap_config' isn't known
    static const struct regmap_config regmap_config = {
                                      ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/regmap_config +1570 drivers/rtc/rtc-ds1307.c

445c02076f1e60 Akinobu Mita             2016-01-25  1569  
11e5890b5342c8 Heiner Kallweit          2017-03-10 @1570  static const struct regmap_config regmap_config = {
11e5890b5342c8 Heiner Kallweit          2017-03-10 @1571  	.reg_bits = 8,
11e5890b5342c8 Heiner Kallweit          2017-03-10 @1572  	.val_bits = 8,
11e5890b5342c8 Heiner Kallweit          2017-03-10  1573  };
11e5890b5342c8 Heiner Kallweit          2017-03-10  1574  
5a167f4543e45d Greg Kroah-Hartman       2012-12-21  1575  static int ds1307_probe(struct i2c_client *client,
d2653e92732bd3 Jean Delvare             2008-04-29  1576  			const struct i2c_device_id *id)
1abb0dc92d706e David Brownell           2006-06-25  1577  {
1abb0dc92d706e David Brownell           2006-06-25  1578  	struct ds1307		*ds1307;
1abb0dc92d706e David Brownell           2006-06-25  1579  	int			err = -ENODEV;
584ce30c72954e Heiner Kallweit          2017-08-29  1580  	int			tmp;
7624df482d7aba Heiner Kallweit          2017-07-12  1581  	const struct chip_desc	*chip;
82e2d43f6315d7 Heiner Kallweit          2017-07-12  1582  	bool			want_irq;
8bc2a40730ec74 Michael Lange            2016-01-21  1583  	bool			ds1307_can_wakeup_device = false;
042fa8c7c04dd4 Alexandre Belloni        2017-09-04  1584  	unsigned char		regs[8];
01ce893d37f053 Jingoo Han               2013-11-12  1585  	struct ds1307_platform_data *pdata = dev_get_platdata(&client->dev);
d8490fd55ab90e Heiner Kallweit          2017-07-12  1586  	u8			trickle_charger_setup = 0;
1abb0dc92d706e David Brownell           2006-06-25  1587  
edca66d2ceae6b Jingoo Han               2013-07-03  1588  	ds1307 = devm_kzalloc(&client->dev, sizeof(struct ds1307), GFP_KERNEL);
40ce972d59fcfd David Anders             2012-03-23  1589  	if (!ds1307)
c065f35c179290 David Brownell           2007-07-17  1590  		return -ENOMEM;
045e0e85f2f6ee David Brownell           2007-07-17  1591  
11e5890b5342c8 Heiner Kallweit          2017-03-10  1592  	dev_set_drvdata(&client->dev, ds1307);
11e5890b5342c8 Heiner Kallweit          2017-03-10  1593  	ds1307->dev = &client->dev;
11e5890b5342c8 Heiner Kallweit          2017-03-10  1594  	ds1307->name = client->name;
33df2ee1bb59b8 Joakim Tjernlund         2009-06-17  1595  
11e5890b5342c8 Heiner Kallweit          2017-03-10 @1596  	ds1307->regmap = devm_regmap_init_i2c(client, &regmap_config);
11e5890b5342c8 Heiner Kallweit          2017-03-10  1597  	if (IS_ERR(ds1307->regmap)) {
11e5890b5342c8 Heiner Kallweit          2017-03-10  1598  		dev_err(ds1307->dev, "regmap allocation failed\n");
11e5890b5342c8 Heiner Kallweit          2017-03-10  1599  		return PTR_ERR(ds1307->regmap);
11e5890b5342c8 Heiner Kallweit          2017-03-10  1600  	}
11e5890b5342c8 Heiner Kallweit          2017-03-10  1601  
11e5890b5342c8 Heiner Kallweit          2017-03-10  1602  	i2c_set_clientdata(client, ds1307);
7ef6d2c266e5b0 Javier Martinez Canillas 2017-03-03  1603  
7ef6d2c266e5b0 Javier Martinez Canillas 2017-03-03  1604  	if (client->dev.of_node) {
7ef6d2c266e5b0 Javier Martinez Canillas 2017-03-03  1605  		ds1307->type = (enum ds_type)
7ef6d2c266e5b0 Javier Martinez Canillas 2017-03-03  1606  			of_device_get_match_data(&client->dev);
7ef6d2c266e5b0 Javier Martinez Canillas 2017-03-03  1607  		chip = &chips[ds1307->type];
7ef6d2c266e5b0 Javier Martinez Canillas 2017-03-03  1608  	} else if (id) {
9c19b8930d2cf9 Tin Huynh                2016-11-30  1609  		chip = &chips[id->driver_data];
3760f736716f74 Jean Delvare             2008-04-29  1610  		ds1307->type = id->driver_data;
9c19b8930d2cf9 Tin Huynh                2016-11-30  1611  	} else {
9c19b8930d2cf9 Tin Huynh                2016-11-30  1612  		const struct acpi_device_id *acpi_id;
9c19b8930d2cf9 Tin Huynh                2016-11-30  1613  
9c19b8930d2cf9 Tin Huynh                2016-11-30  1614  		acpi_id = acpi_match_device(ACPI_PTR(ds1307_acpi_ids),
11e5890b5342c8 Heiner Kallweit          2017-03-10  1615  					    ds1307->dev);
9c19b8930d2cf9 Tin Huynh                2016-11-30  1616  		if (!acpi_id)
9c19b8930d2cf9 Tin Huynh                2016-11-30  1617  			return -ENODEV;
9c19b8930d2cf9 Tin Huynh                2016-11-30  1618  		chip = &chips[acpi_id->driver_data];
9c19b8930d2cf9 Tin Huynh                2016-11-30  1619  		ds1307->type = acpi_id->driver_data;
9c19b8930d2cf9 Tin Huynh                2016-11-30  1620  	}
33df2ee1bb59b8 Joakim Tjernlund         2009-06-17  1621  
82e2d43f6315d7 Heiner Kallweit          2017-07-12  1622  	want_irq = client->irq > 0 && chip->alarm;
82e2d43f6315d7 Heiner Kallweit          2017-07-12  1623  
9c19b8930d2cf9 Tin Huynh                2016-11-30  1624  	if (!pdata)
d8490fd55ab90e Heiner Kallweit          2017-07-12  1625  		trickle_charger_setup = ds1307_trickle_init(ds1307, chip);
9c19b8930d2cf9 Tin Huynh                2016-11-30  1626  	else if (pdata->trickle_charger_setup)
d8490fd55ab90e Heiner Kallweit          2017-07-12  1627  		trickle_charger_setup = pdata->trickle_charger_setup;
33b04b7b7c03d0 Matti Vaittinen          2014-10-13  1628  
d8490fd55ab90e Heiner Kallweit          2017-07-12  1629  	if (trickle_charger_setup && chip->trickle_charger_reg) {
d8490fd55ab90e Heiner Kallweit          2017-07-12  1630  		trickle_charger_setup |= DS13XX_TRICKLE_CHARGER_MAGIC;
11e5890b5342c8 Heiner Kallweit          2017-03-10  1631  		dev_dbg(ds1307->dev,
11e5890b5342c8 Heiner Kallweit          2017-03-10  1632  			"writing trickle charger info 0x%x to 0x%x\n",
d8490fd55ab90e Heiner Kallweit          2017-07-12  1633  			trickle_charger_setup, chip->trickle_charger_reg);
11e5890b5342c8 Heiner Kallweit          2017-03-10  1634  		regmap_write(ds1307->regmap, chip->trickle_charger_reg,
d8490fd55ab90e Heiner Kallweit          2017-07-12  1635  			     trickle_charger_setup);
33b04b7b7c03d0 Matti Vaittinen          2014-10-13  1636  	}
eb86c3064b3c53 Wolfram Sang             2012-05-29  1637  

:::::: The code at line 1570 was first introduced by commit
:::::: 11e5890b5342c82eefbaa39aec4767ae21ae8803 rtc: ds1307: convert driver to regmap

:::::: TO: Heiner Kallweit <hkallweit1@gmail.com>
:::::: CC: Alexandre Belloni <alexandre.belloni@free-electrons.com>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
kbuild test robot Jan. 13, 2020, 1:29 a.m. UTC | #2
Hi Geert,

I love your patch! Yet something to improve:

[auto build test ERROR on abelloni/rtc-next]
[also build test ERROR on v5.5-rc5 next-20200110]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Geert-Uytterhoeven/rtc-i2c-spi-Avoid-inclusion-of-REGMAP-support-when-not-needed/20200113-013332
base:   https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
config: arm-mv78xx0_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/rtc/rtc-ds1307.o: In function `ds1307_probe':
>> rtc-ds1307.c:(.text+0x14f4): undefined reference to `__devm_regmap_init_i2c'

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
Joe Perches Jan. 13, 2020, 6:36 a.m. UTC | #3
On Sun, 2020-01-12 at 18:13 +0100, Geert Uytterhoeven wrote:
> Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when
> no driver needs it.  While the former can be moduler, the latter cannot,
> and thus becomes built-in.
> 
> Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI
> from the RTC_I2C_AND_SPI helper to the individual drivers that depend on
> it.
> 
> Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI
> for more information, but the latter does not select REGMAP_{I2C,SPI}
> itself, and defers that to the individual drivers, too.
> 
> Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> Joe: When merging addresses, scripts/get_maintainer.pl replaces
>      Alexandre's authoritative email address from MAINTAINERS by the
>      obsolete address in the SoB-line of the commit referred to by the
>      Fixes-line.

Hi Geert

What are you doing to get this changed output?

I get the same get_maintainer address output either way
with only with the 'blamed_fixes:' content added.

Your email with 'Fixes:' line:

$ ./scripts/get_maintainer.pl ~/geert_1.mbox 
Alessandro Zummo <a.zummo@towertech.it> (maintainer:REAL TIME CLOCK (RTC) SUBSYSTEM)
Alexandre Belloni <alexandre.belloni@bootlin.com> (maintainer:REAL TIME CLOCK (RTC) SUBSYSTEM,blamed_fixes:1/1=100%)
Akinobu Mita <akinobu.mita@gmail.com> (blamed_fixes:1/1=100%)
linux-rtc@vger.kernel.org (open list:REAL TIME CLOCK (RTC) SUBSYSTEM)
linux-kernel@vger.kernel.org (open list)

Your email without 'Fixes:' line:

$ ./scripts/get_maintainer.pl ~/geert_2.mbox 
Alessandro Zummo <a.zummo@towertech.it> (maintainer:REAL TIME CLOCK (RTC) SUBSYSTEM)
Alexandre Belloni <alexandre.belloni@bootlin.com> (maintainer:REAL TIME CLOCK (RTC) SUBSYSTEM)
linux-rtc@vger.kernel.org (open list:REAL TIME CLOCK (RTC) SUBSYSTEM)
linux-kernel@vger.kernel.org (open list)
Geert Uytterhoeven Jan. 13, 2020, 7:25 a.m. UTC | #4
Hi Joe,

On Mon, Jan 13, 2020 at 7:36 AM Joe Perches <joe@perches.com> wrote:
> On Sun, 2020-01-12 at 18:13 +0100, Geert Uytterhoeven wrote:
> > Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when
> > no driver needs it.  While the former can be moduler, the latter cannot,
> > and thus becomes built-in.
> >
> > Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI
> > from the RTC_I2C_AND_SPI helper to the individual drivers that depend on
> > it.
> >
> > Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI
> > for more information, but the latter does not select REGMAP_{I2C,SPI}
> > itself, and defers that to the individual drivers, too.
> >
> > Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234")
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > ---
> > Joe: When merging addresses, scripts/get_maintainer.pl replaces
> >      Alexandre's authoritative email address from MAINTAINERS by the
> >      obsolete address in the SoB-line of the commit referred to by the
> >      Fixes-line.
>
> Hi Geert
>
> What are you doing to get this changed output?

scripts/get_maintainer.pl
0001-rtc-i2c-spi-Avoid-inclusion-of-REGMAP-support-when-n.patch

> I get the same get_maintainer address output either way
> with only with the 'blamed_fixes:' content added.

Thanks, I can confirm it's fixed in next-20200110.
With v5.5-rc6, it still gives the old addresss.

Gr{oetje,eeting}s,

                        Geert
Joe Perches Jan. 13, 2020, 7:40 a.m. UTC | #5
On Mon, 2020-01-13 at 08:25 +0100, Geert Uytterhoeven wrote:
> Hi Joe,
> 
> On Mon, Jan 13, 2020 at 7:36 AM Joe Perches <joe@perches.com> wrote:
> > On Sun, 2020-01-12 at 18:13 +0100, Geert Uytterhoeven wrote:
> > > Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when
> > > no driver needs it.  While the former can be moduler, the latter cannot,
> > > and thus becomes built-in.
> > > 
> > > Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI
> > > from the RTC_I2C_AND_SPI helper to the individual drivers that depend on
> > > it.
> > > 
> > > Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI
> > > for more information, but the latter does not select REGMAP_{I2C,SPI}
> > > itself, and defers that to the individual drivers, too.
> > > 
> > > Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234")
> > > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > > ---
> > > Joe: When merging addresses, scripts/get_maintainer.pl replaces
> > >      Alexandre's authoritative email address from MAINTAINERS by the
> > >      obsolete address in the SoB-line of the commit referred to by the
> > >      Fixes-line.
> > 
> > Hi Geert
> > 
> > What are you doing to get this changed output?
> 
> scripts/get_maintainer.pl
> 0001-rtc-i2c-spi-Avoid-inclusion-of-REGMAP-support-when-n.patch
> 
> > I get the same get_maintainer address output either way
> > with only with the 'blamed_fixes:' content added.
> 
> Thanks, I can confirm it's fixed in next-20200110.
> With v5.5-rc6, it still gives the old addresss.

Well, OK, get_maintainer is the same but there is a
different .mailmap in -next

$ git log --stat -p -1 94a250713
commit 94a25071301a898d8c603db2f05a0016eb7b7d28
Author: Alexandre Belloni <alexandre.belloni@bootlin.com>
Date:   Tue Dec 10 14:46:53 2019 +0100

    mailmap: Update email address for Alexandre Belloni
    
    Free Electrons is now Bootlin.
    
    Link: https://lore.kernel.org/r/20191210134653.2995661-1-alexandre.belloni@bootlin.com
    Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Geert Uytterhoeven Jan. 13, 2020, 7:57 a.m. UTC | #6
Hi Joe,

On Mon, Jan 13, 2020 at 8:41 AM Joe Perches <joe@perches.com> wrote:
> On Mon, 2020-01-13 at 08:25 +0100, Geert Uytterhoeven wrote:
> > On Mon, Jan 13, 2020 at 7:36 AM Joe Perches <joe@perches.com> wrote:
> > > On Sun, 2020-01-12 at 18:13 +0100, Geert Uytterhoeven wrote:
> > > > Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when
> > > > no driver needs it.  While the former can be moduler, the latter cannot,
> > > > and thus becomes built-in.
> > > >
> > > > Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI
> > > > from the RTC_I2C_AND_SPI helper to the individual drivers that depend on
> > > > it.
> > > >
> > > > Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI
> > > > for more information, but the latter does not select REGMAP_{I2C,SPI}
> > > > itself, and defers that to the individual drivers, too.
> > > >
> > > > Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234")
> > > > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > > > ---
> > > > Joe: When merging addresses, scripts/get_maintainer.pl replaces
> > > >      Alexandre's authoritative email address from MAINTAINERS by the
> > > >      obsolete address in the SoB-line of the commit referred to by the
> > > >      Fixes-line.
> > >
> > > Hi Geert
> > >
> > > What are you doing to get this changed output?
> >
> > scripts/get_maintainer.pl
> > 0001-rtc-i2c-spi-Avoid-inclusion-of-REGMAP-support-when-n.patch
> >
> > > I get the same get_maintainer address output either way
> > > with only with the 'blamed_fixes:' content added.
> >
> > Thanks, I can confirm it's fixed in next-20200110.
> > With v5.5-rc6, it still gives the old addresss.
>
> Well, OK, get_maintainer is the same but there is a
> different .mailmap in -next

Indeed.

However, I think the precedence should be

    MAINTAINERS > .mailmap > SoB in referenced commit

instead of

    .mailmap > SoB in referenced commit > MAINTAINERS

Do you agree?
Thanks!

Gr{oetje,eeting}s,

                        Geert
Joe Perches Jan. 13, 2020, 8:12 a.m. UTC | #7
On Mon, 2020-01-13 at 08:57 +0100, Geert Uytterhoeven wrote:
> On Mon, Jan 13, 2020 at 8:41 AM Joe Perches <joe@perches.com> wrote:
> > On Mon, 2020-01-13 at 08:25 +0100, Geert Uytterhoeven wrote:
> > > On Mon, Jan 13, 2020 at 7:36 AM Joe Perches <joe@perches.com> wrote:
> > > > On Sun, 2020-01-12 at 18:13 +0100, Geert Uytterhoeven wrote:
> > > > > Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when
> > > > > no driver needs it.  While the former can be moduler, the latter cannot,
> > > > > and thus becomes built-in.
> > > > > 
> > > > > Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI
> > > > > from the RTC_I2C_AND_SPI helper to the individual drivers that depend on
> > > > > it.
> > > > > 
> > > > > Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI
> > > > > for more information, but the latter does not select REGMAP_{I2C,SPI}
> > > > > itself, and defers that to the individual drivers, too.
> > > > > 
> > > > > Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234")
> > > > > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > > > > ---
> > > > > Joe: When merging addresses, scripts/get_maintainer.pl replaces
> > > > >      Alexandre's authoritative email address from MAINTAINERS by the
> > > > >      obsolete address in the SoB-line of the commit referred to by the
> > > > >      Fixes-line.
> > > > What are you doing to get this changed output?
> > > 
> > > scripts/get_maintainer.pl
> > > 0001-rtc-i2c-spi-Avoid-inclusion-of-REGMAP-support-when-n.patch
> > > 
> > > > I get the same get_maintainer address output either way
> > > > with only with the 'blamed_fixes:' content added.
> > > 
> > > Thanks, I can confirm it's fixed in next-20200110.
> > > With v5.5-rc6, it still gives the old addresss.
> > 
> > Well, OK, get_maintainer is the same but there is a
> > different .mailmap in -next
> 
> Indeed.
> 
> However, I think the precedence should be
> 
>     MAINTAINERS > .mailmap > SoB in referenced commit
> 
> instead of
> 
>     .mailmap > SoB in referenced commit > MAINTAINERS
> 
> Do you agree?

Well, not really.  Priority is:

	1 .mailmap address
	2 SoB address in commit message
	2 SoB
address in referenced Fixes: commits
	3 MAINTAINERS address

MAINTAINER entries are sometimes stale and .mailmap
is generally more current so perhaps it should be

	1 .mailmap address
	2 SoB address in commit message
	3 MAINTAINERS address
	4 SoB address in referenced Fixes: commits

But it seems a restructuring of get_maintainer
would be required to do that as the Fixes: line is
parsed before any filenames in a patch and I'm not
too bothered by the precedence and output right
now to muck around in get_maintainer's internals.

cheers, Joe
Geert Uytterhoeven Jan. 14, 2020, 10:13 a.m. UTC | #8
Hi Joe,

On Mon, Jan 13, 2020 at 9:13 AM Joe Perches <joe@perches.com> wrote:
> On Mon, 2020-01-13 at 08:57 +0100, Geert Uytterhoeven wrote:
> > On Mon, Jan 13, 2020 at 8:41 AM Joe Perches <joe@perches.com> wrote:
> > > On Mon, 2020-01-13 at 08:25 +0100, Geert Uytterhoeven wrote:
> > > > On Mon, Jan 13, 2020 at 7:36 AM Joe Perches <joe@perches.com> wrote:
> > > > > On Sun, 2020-01-12 at 18:13 +0100, Geert Uytterhoeven wrote:
> > > > > > Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when
> > > > > > no driver needs it.  While the former can be moduler, the latter cannot,
> > > > > > and thus becomes built-in.
> > > > > >
> > > > > > Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI
> > > > > > from the RTC_I2C_AND_SPI helper to the individual drivers that depend on
> > > > > > it.
> > > > > >
> > > > > > Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI
> > > > > > for more information, but the latter does not select REGMAP_{I2C,SPI}
> > > > > > itself, and defers that to the individual drivers, too.
> > > > > >
> > > > > > Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234")
> > > > > > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > > > > > ---
> > > > > > Joe: When merging addresses, scripts/get_maintainer.pl replaces
> > > > > >      Alexandre's authoritative email address from MAINTAINERS by the
> > > > > >      obsolete address in the SoB-line of the commit referred to by the
> > > > > >      Fixes-line.
> > > > > What are you doing to get this changed output?
> > > >
> > > > scripts/get_maintainer.pl
> > > > 0001-rtc-i2c-spi-Avoid-inclusion-of-REGMAP-support-when-n.patch
> > > >
> > > > > I get the same get_maintainer address output either way
> > > > > with only with the 'blamed_fixes:' content added.
> > > >
> > > > Thanks, I can confirm it's fixed in next-20200110.
> > > > With v5.5-rc6, it still gives the old addresss.
> > >
> > > Well, OK, get_maintainer is the same but there is a
> > > different .mailmap in -next
> >
> > Indeed.
> >
> > However, I think the precedence should be
> >
> >     MAINTAINERS > .mailmap > SoB in referenced commit
> >
> > instead of
> >
> >     .mailmap > SoB in referenced commit > MAINTAINERS
> >
> > Do you agree?
>
> Well, not really.  Priority is:
>
>         1 .mailmap address
>         2 SoB address in commit message
>         2 SoB
> address in referenced Fixes: commits
>         3 MAINTAINERS address
>
> MAINTAINER entries are sometimes stale and .mailmap
> is generally more current so perhaps it should be
>
>         1 .mailmap address
>         2 SoB address in commit message
>         3 MAINTAINERS address
>         4 SoB address in referenced Fixes: commits
>
> But it seems a restructuring of get_maintainer
> would be required to do that as the Fixes: line is
> parsed before any filenames in a patch and I'm not
> too bothered by the precedence and output right
> now to muck around in get_maintainer's internals.

Exactly. There's a reason I just reported the issue, instead of sending a
patch ;-)

Gr{oetje,eeting}s,

                        Geert
Alexandre Belloni Jan. 27, 2020, 10:45 p.m. UTC | #9
On 12/01/2020 18:13:49+0100, Geert Uytterhoeven wrote:
> Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when
> no driver needs it.  While the former can be moduler, the latter cannot,
> and thus becomes built-in.
> 
> Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI
> from the RTC_I2C_AND_SPI helper to the individual drivers that depend on
> it.
> 
> Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI
> for more information, but the latter does not select REGMAP_{I2C,SPI}
> itself, and defers that to the individual drivers, too.
> 
> Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> Joe: When merging addresses, scripts/get_maintainer.pl replaces
>      Alexandre's authoritative email address from MAINTAINERS by the
>      obsolete address in the SoB-line of the commit referred to by the
>      Fixes-line.
> 
>  drivers/rtc/Kconfig | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
Applied, thanks.
Geert Uytterhoeven Jan. 28, 2020, 8:33 a.m. UTC | #10
Hi Alexandre,

On Mon, Jan 27, 2020 at 11:45 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> On 12/01/2020 18:13:49+0100, Geert Uytterhoeven wrote:
> > Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when
> > no driver needs it.  While the former can be moduler, the latter cannot,
> > and thus becomes built-in.
> >
> > Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI
> > from the RTC_I2C_AND_SPI helper to the individual drivers that depend on
> > it.
> >
> > Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI
> > for more information, but the latter does not select REGMAP_{I2C,SPI}
> > itself, and defers that to the individual drivers, too.
> >
> > Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234")
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > ---
> > Joe: When merging addresses, scripts/get_maintainer.pl replaces
> >      Alexandre's authoritative email address from MAINTAINERS by the
> >      obsolete address in the SoB-line of the commit referred to by the
> >      Fixes-line.
> >
> >  drivers/rtc/Kconfig | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> >
> Applied, thanks.

According to the reports from kbuild test report, some drivers are still
missing some selects, which is exposed by this patch.
But perhaps you have already fixed those in your tree?

Gr{oetje,eeting}s,

                        Geert
Alexandre Belloni Jan. 28, 2020, 8:50 a.m. UTC | #11
Hi,

On 28/01/2020 09:33:28+0100, Geert Uytterhoeven wrote:
> Hi Alexandre,
> 
> On Mon, Jan 27, 2020 at 11:45 PM Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
> > On 12/01/2020 18:13:49+0100, Geert Uytterhoeven wrote:
> > > Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when
> > > no driver needs it.  While the former can be moduler, the latter cannot,
> > > and thus becomes built-in.
> > >
> > > Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI
> > > from the RTC_I2C_AND_SPI helper to the individual drivers that depend on
> > > it.
> > >
> > > Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI
> > > for more information, but the latter does not select REGMAP_{I2C,SPI}
> > > itself, and defers that to the individual drivers, too.
> > >
> > > Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234")
> > > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > > ---
> > > Joe: When merging addresses, scripts/get_maintainer.pl replaces
> > >      Alexandre's authoritative email address from MAINTAINERS by the
> > >      obsolete address in the SoB-line of the commit referred to by the
> > >      Fixes-line.
> > >
> > >  drivers/rtc/Kconfig | 8 ++++++--
> > >  1 file changed, 6 insertions(+), 2 deletions(-)
> > >
> > Applied, thanks.
> 
> According to the reports from kbuild test report, some drivers are still
> missing some selects, which is exposed by this patch.
> But perhaps you have already fixed those in your tree?
> 

I did fix a bunch of those in
https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git/commit/?h=rtc-next&id=578c2b661e2b1b474ea3571a3c3c6d57bae89e8d

kbuild reported that it successfully built a few configuration with that
patch applied so I'm hoping it is enough.
Geert Uytterhoeven Jan. 28, 2020, 8:59 a.m. UTC | #12
Hi Alexandre,

On Tue, Jan 28, 2020 at 9:50 AM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> On 28/01/2020 09:33:28+0100, Geert Uytterhoeven wrote:
> > On Mon, Jan 27, 2020 at 11:45 PM Alexandre Belloni
> > <alexandre.belloni@bootlin.com> wrote:
> > > On 12/01/2020 18:13:49+0100, Geert Uytterhoeven wrote:
> > > > Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when
> > > > no driver needs it.  While the former can be moduler, the latter cannot,
> > > > and thus becomes built-in.
> > > >
> > > > Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI
> > > > from the RTC_I2C_AND_SPI helper to the individual drivers that depend on
> > > > it.
> > > >
> > > > Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI
> > > > for more information, but the latter does not select REGMAP_{I2C,SPI}
> > > > itself, and defers that to the individual drivers, too.
> > > >
> > > > Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234")
> > > > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > > > ---
> > > > Joe: When merging addresses, scripts/get_maintainer.pl replaces
> > > >      Alexandre's authoritative email address from MAINTAINERS by the
> > > >      obsolete address in the SoB-line of the commit referred to by the
> > > >      Fixes-line.
> > > >
> > > >  drivers/rtc/Kconfig | 8 ++++++--
> > > >  1 file changed, 6 insertions(+), 2 deletions(-)
> > > >
> > > Applied, thanks.
> >
> > According to the reports from kbuild test report, some drivers are still
> > missing some selects, which is exposed by this patch.
> > But perhaps you have already fixed those in your tree?
> >
>
> I did fix a bunch of those in
> https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git/commit/?h=rtc-next&id=578c2b661e2b1b474ea3571a3c3c6d57bae89e8d
>
> kbuild reported that it successfully built a few configuration with that
> patch applied so I'm hoping it is enough.

Great, thanks a lot!

Gr{oetje,eeting}s,

                        Geert

Patch
diff mbox series

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index d77515d8382c7a72..738fa071884094d1 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -848,14 +848,14 @@  config RTC_I2C_AND_SPI
 	default m if I2C=m
 	default y if I2C=y
 	default y if SPI_MASTER=y
-	select REGMAP_I2C if I2C
-	select REGMAP_SPI if SPI_MASTER
 
 comment "SPI and I2C RTC drivers"
 
 config RTC_DRV_DS3232
 	tristate "Dallas/Maxim DS3232/DS3234"
 	depends on RTC_I2C_AND_SPI
+	select REGMAP_I2C if I2C
+	select REGMAP_SPI if SPI_MASTER
 	help
 	  If you say yes here you get support for Dallas Semiconductor
 	  DS3232 and DS3234 real-time clock chips. If an interrupt is associated
@@ -875,6 +875,8 @@  config RTC_DRV_DS3232_HWMON
 config RTC_DRV_PCF2127
 	tristate "NXP PCF2127"
 	depends on RTC_I2C_AND_SPI
+	select REGMAP_I2C if I2C
+	select REGMAP_SPI if SPI_MASTER
 	select WATCHDOG_CORE if WATCHDOG
 	help
 	  If you say yes here you get support for the NXP PCF2127/29 RTC
@@ -891,6 +893,8 @@  config RTC_DRV_PCF2127
 config RTC_DRV_RV3029C2
 	tristate "Micro Crystal RV3029/3049"
 	depends on RTC_I2C_AND_SPI
+	select REGMAP_I2C if I2C
+	select REGMAP_SPI if SPI_MASTER
 	help
 	  If you say yes here you get support for the Micro Crystal
 	  RV3029 and RV3049 RTC chips.