All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] mfd: intel_soc_pmic_core: Remove unnecessary function
@ 2017-02-20 18:21 Andy Shevchenko
  2017-02-21  3:40 ` kbuild test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2017-02-20 18:21 UTC (permalink / raw)
  To: Lee Jones, linux-kernel; +Cc: Andy Shevchenko

Since commit 845c877009cf ("i2c / ACPI: Assign IRQ for devices that have
GpioInt automatically") I2C core assigns interrupt line to I2C slave
devices with regarding to GpioInt() resources.

There is no need to repeat this in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mfd/intel_soc_pmic_core.c | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_core.c b/drivers/mfd/intel_soc_pmic_core.c
index 12d6ebb4ae5d..d584175e3cd6 100644
--- a/drivers/mfd/intel_soc_pmic_core.c
+++ b/drivers/mfd/intel_soc_pmic_core.c
@@ -44,22 +44,6 @@ static struct pwm_lookup crc_pwm_lookup[] = {
 	PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_backlight", 0, PWM_POLARITY_NORMAL),
 };
 
-static int intel_soc_pmic_find_gpio_irq(struct device *dev)
-{
-	struct gpio_desc *desc;
-	int irq;
-
-	desc = devm_gpiod_get_index(dev, "intel_soc_pmic", 0, GPIOD_IN);
-	if (IS_ERR(desc))
-		return PTR_ERR(desc);
-
-	irq = gpiod_to_irq(desc);
-	if (irq < 0)
-		dev_warn(dev, "Can't get irq: %d\n", irq);
-
-	return irq;
-}
-
 static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
 				    const struct i2c_device_id *i2c_id)
 {
@@ -83,14 +67,7 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
 	dev_set_drvdata(dev, pmic);
 
 	pmic->regmap = devm_regmap_init_i2c(i2c, config->regmap_config);
-
-	/*
-	 * On some boards the PMIC interrupt may come from a GPIO line. Try to
-	 * lookup the ACPI table for a such connection and setup a GPIO
-	 * interrupt if it exists. Otherwise use the IRQ provided by I2C
-	 */
-	irq = intel_soc_pmic_find_gpio_irq(dev);
-	pmic->irq = (irq < 0) ? i2c->irq : irq;
+	pmic->irq = i2c->irq;
 
 	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
 				  config->irq_flags | IRQF_ONESHOT,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] mfd: intel_soc_pmic_core: Remove unnecessary function
  2017-02-20 18:21 [PATCH v1] mfd: intel_soc_pmic_core: Remove unnecessary function Andy Shevchenko
@ 2017-02-21  3:40 ` kbuild test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2017-02-21  3:40 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: kbuild-all, Lee Jones, linux-kernel, Andy Shevchenko

[-- Attachment #1: Type: text/plain, Size: 3069 bytes --]

Hi Andy,

[auto build test WARNING on ljones-mfd/for-mfd-next]
[also build test WARNING on v4.10 next-20170220]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Andy-Shevchenko/mfd-intel_soc_pmic_core-Remove-unnecessary-function/20170221-034944
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: openrisc-allyesconfig (attached as .config)
compiler: or32-linux-gcc (GCC) 4.5.1-or32-1.0rc1
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=openrisc 

All warnings (new ones prefixed by >>):

   drivers/mfd/intel_soc_pmic_core.c: In function 'intel_soc_pmic_i2c_probe':
>> drivers/mfd/intel_soc_pmic_core.c:55:6: warning: unused variable 'irq'

vim +/irq +55 drivers/mfd/intel_soc_pmic_core.c

61dd2ca2 Shobhit Kumar 2015-06-26  39  	},
61dd2ca2 Shobhit Kumar 2015-06-26  40  };
61dd2ca2 Shobhit Kumar 2015-06-26  41  
a3aa9a93 Shobhit Kumar 2015-06-26  42  /* PWM consumed by the Intel GFX */
a3aa9a93 Shobhit Kumar 2015-06-26  43  static struct pwm_lookup crc_pwm_lookup[] = {
a3aa9a93 Shobhit Kumar 2015-06-26  44  	PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_backlight", 0, PWM_POLARITY_NORMAL),
a3aa9a93 Shobhit Kumar 2015-06-26  45  };
a3aa9a93 Shobhit Kumar 2015-06-26  46  
51652384 Zhu, Lejun    2014-06-03  47  static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
51652384 Zhu, Lejun    2014-06-03  48  				    const struct i2c_device_id *i2c_id)
51652384 Zhu, Lejun    2014-06-03  49  {
51652384 Zhu, Lejun    2014-06-03  50  	struct device *dev = &i2c->dev;
51652384 Zhu, Lejun    2014-06-03  51  	const struct acpi_device_id *id;
51652384 Zhu, Lejun    2014-06-03  52  	struct intel_soc_pmic_config *config;
51652384 Zhu, Lejun    2014-06-03  53  	struct intel_soc_pmic *pmic;
51652384 Zhu, Lejun    2014-06-03  54  	int ret;
51652384 Zhu, Lejun    2014-06-03 @55  	int irq;
51652384 Zhu, Lejun    2014-06-03  56  
51652384 Zhu, Lejun    2014-06-03  57  	id = acpi_match_device(dev->driver->acpi_match_table, dev);
51652384 Zhu, Lejun    2014-06-03  58  	if (!id || !id->driver_data)
51652384 Zhu, Lejun    2014-06-03  59  		return -ENODEV;
51652384 Zhu, Lejun    2014-06-03  60  
51652384 Zhu, Lejun    2014-06-03  61  	config = (struct intel_soc_pmic_config *)id->driver_data;
51652384 Zhu, Lejun    2014-06-03  62  
51652384 Zhu, Lejun    2014-06-03  63  	pmic = devm_kzalloc(dev, sizeof(*pmic), GFP_KERNEL);

:::::: The code at line 55 was first introduced by commit
:::::: 5165238460068e53c740eaa621ebb6623dc4a50d mfd: intel_soc_pmic: Core driver

:::::: TO: Zhu, Lejun <lejun.zhu@linux.intel.com>
:::::: CC: Lee Jones <lee.jones@linaro.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40190 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-21  3:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20 18:21 [PATCH v1] mfd: intel_soc_pmic_core: Remove unnecessary function Andy Shevchenko
2017-02-21  3:40 ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.