Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5941798ybi; Wed, 12 Jun 2019 11:05:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqm0NuT6jYi5gnRdtbDTWorbcy7aAyC8wFmcqq8kGhz6MUAR0zFb38PkqdUfnBqxc+TybF X-Received: by 2002:a63:e250:: with SMTP id y16mr25611331pgj.392.1560362755168; Wed, 12 Jun 2019 11:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560362755; cv=none; d=google.com; s=arc-20160816; b=IcBXykZ0Epbb+NhwCNQ086SubY5oNPaRQaLCjtDo5UewWHfAs6P2ODiRx/bwkTdSom PoXtUSoLU2U7FFiB1QjR2RX2VwSTIhpJ/SU1CN1dexOp2++jgt799NJzki3V8jjqpojU 3YLJCZqGWbZFWYN26wzCwNjX4dhhcgyYIt6aT3jcrYJzzcz1RoU6yjA8veYhFPXaowLY CIlMaM4L0lMbYeITXK3vXXDN8Pg/vAQDb1rDRglkLbpE+lb4TiH6Ij3SE11nk1X9PPFN jO+qD7Ulfspy/Yq+nolowE8n3eUEKaYI8FH4jrGkK06hE62w0yI4RVvhWapkguV3+4ww EBUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mV9wwkR5LwuQVo2jmO0eDzLaM5TXfcSBqwUnfWWibLQ=; b=v/MmxoyyGGdHZsslFD8Ec6t1kS1vBduXdRQcwL8/BZnACbw1UyqduEn0dEdt+uV4FV IOrXvg8weKkAU9yCGN/rnLg9O9sX/Mra1x+4qXQ2eF31Hkb4yBVMxy0WwrwB05Xw9fSC BaebIEQCIs/oaXHTwpi0e17aEj3vtNBu2bsNGowGPrQs5cTcS4lcZEkcC1Sr8LgO9XYy VAgIHTcc6VFPJF5moMTvsUUDht3f92OldF5DxZbZ+dx5VKvz20EhEQqmlCcTcQvkpwRK HhpZKf73Vc3umRfCLV58JDlMtXngH766IDV6nH4a2lyUYRh1d+lj539GuDPt6OCq/8+I Vjog== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si310546plb.274.2019.06.12.11.05.40; Wed, 12 Jun 2019 11:05:55 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408863AbfFLP1Y (ORCPT + 99 others); Wed, 12 Jun 2019 11:27:24 -0400 Received: from mga06.intel.com ([134.134.136.31]:62144 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405706AbfFLP1Y (ORCPT ); Wed, 12 Jun 2019 11:27:24 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 08:27:23 -0700 X-ExtLoop1: 1 Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 12 Jun 2019 08:27:19 -0700 Received: by lahna (sSMTP sendmail emulation); Wed, 12 Jun 2019 18:27:18 +0300 Date: Wed, 12 Jun 2019 18:27:18 +0300 From: Mika Westerberg To: Charles Keepax Cc: wsa@the-dreams.de, jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, benjamin.tissoires@redhat.com, jbroadus@gmail.com, patches@opensource.cirrus.com Subject: Re: [PATCH v4 4/7] i2c: core: Make i2c_acpi_get_irq available to the rest of the I2C core Message-ID: <20190612152718.GC2640@lahna.fi.intel.com> References: <20190611123101.25264-1-ckeepax@opensource.cirrus.com> <20190611123101.25264-5-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190611123101.25264-5-ckeepax@opensource.cirrus.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 11, 2019 at 01:30:58PM +0100, Charles Keepax wrote: > In preparation for more refactoring make i2c_acpi_get_irq available > outside i2c-core-acpi.c. > > Signed-off-by: Charles Keepax > --- > > Changes since v3: > - Move the change to use the helper function from i2c-core-base into its own patch. > > Thanks, > Charles > > drivers/i2c/i2c-core-acpi.c | 15 +++++++++++++-- > drivers/i2c/i2c-core.h | 7 +++++++ > 2 files changed, 20 insertions(+), 2 deletions(-) > > diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c > index 7d4d66ba752d4..35966cc337dde 100644 > --- a/drivers/i2c/i2c-core-acpi.c > +++ b/drivers/i2c/i2c-core-acpi.c > @@ -144,8 +144,17 @@ static int i2c_acpi_add_resource(struct acpi_resource *ares, void *data) > return 1; /* No need to add resource to the list */ > } > > -static int i2c_acpi_get_irq(struct acpi_device *adev) > +/** > + * i2c_acpi_get_irq - get device IRQ number from ACPI > + * @client: Pointer to the I2C client device > + * > + * Find the IRQ number used by a specific client device. > + * > + * Return: The IRQ number or an error code. > + */ > +int i2c_acpi_get_irq(struct i2c_client *client) > { > + struct acpi_device *adev = ACPI_COMPANION(&client->adapter->dev); Is this adev checked for being NULL somewhere below before it is being dereferenced? It could explain the issue Benjamin is seeing. > struct list_head resource_list; > int irq = -ENOENT; > int ret;