Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7055167ybi; Thu, 13 Jun 2019 08:49:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZveo2ooVYMuZs0pdGgU562A9SaTemthDqhbEQCckoXNi7W2yUrJdFn6/ON03oxSJg97Vy X-Received: by 2002:a17:90a:290b:: with SMTP id g11mr6288071pjd.122.1560440967814; Thu, 13 Jun 2019 08:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560440967; cv=none; d=google.com; s=arc-20160816; b=ctT9fvafRY8SS/oUiCLgfnyAnSmbOhRudUwHvFe699++YvfY2GmrutgbRizKu28+VA iqQxifXhHESOqcMZ2TPCyPb8VYo1GEPP31TCTWpIEeaHF7IMWa8yX6FmojepLMWXG3lA 17odjsWaULiqpne0NYBQ7Or8Jav8IqEIN5OGWxeJZF5q+Ni3WeylQUhUChLBdoPbKgXE tz3SOxic2YgZ/YIqwAC8xTSX1iKzvtgkl9xMQeY5BqZ72KwD0jUxXzKL2kwR0RhQrKa/ J1laySLVC1Ru715K8g0T6vpA8FuRKIgiuEZLMv5DO9BZjbte125nOJ4Sbk4CGrU1W3SZ 6zUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=e/0wpLIS7FS7jhfZMMu4pHMqQtu6yoM37ibHoRt1LgU=; b=KUCrIxMbFu0e7HhfWrP/pwaGvdn+1/DjSQGy3X9Ft2twZL5YLAZmPy7rzVgIoWVQ1E YOh7D6wzMbsDgKo5g9QUqKCM9BLDpkuE8vJNkqALwqfKqkYekPdtMFG7JeJwFHYe9rvi Ys//a0pgHEaiex9gNp48Y6x8snfs7W8gk96yEIK6A9LEvxw1Z9SEcqOlvQJuQEMkI/Ce bKHkz4bFkvu4dPjFsdPExbCMgmOYCQdTTyt3TluqIuijlQ2pHkCEU/aYe9dawBEO5sVH LCBY/3Jtbfs6Pew4VevfCRdwKu79dlC3Bo8AZObQcjqKBraf3dEMkdkZt1XQ1anqeadE yhtw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e19si3413258pfi.91.2019.06.13.08.49.12; Thu, 13 Jun 2019 08:49:27 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732167AbfFMPrT (ORCPT + 99 others); Thu, 13 Jun 2019 11:47:19 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:35401 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731770AbfFMJc7 (ORCPT ); Thu, 13 Jun 2019 05:32:59 -0400 Received: by mail-qt1-f193.google.com with SMTP id d23so21749321qto.2 for ; Thu, 13 Jun 2019 02:32:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e/0wpLIS7FS7jhfZMMu4pHMqQtu6yoM37ibHoRt1LgU=; b=Ji7c5zHL7MNL4WMMr85kiClsMo5Kr1PRabDnQ/VrcjpCI/0K/8ZWs4VujJ1bG3cXWl BTT8/lQlWwyHUZOSFcfZIB9wMR4G4N+GM0tuBKwZMeRg4L5OPMFJiaVtDaPVlHhJ9rt3 DOmYRglRPj3ZLysnuBKWC4LkTQCnQiefIQXUVmGVVVukjibu5hdcGuQdVBgd3Z+5sSlB e+o1udLayhYWcbubKuj3JcFKOJNmZekQgQipa4rw0m+3I/hiBngWxgdozExrZCL//kRF FAQYywh7M5XpovMNRXt193LSFLsncvFh5VECBkjTrUqjalRl3Vi6s5icOS52H3veZiWP iWVg== X-Gm-Message-State: APjAAAVe66yi+hubpiUg0ZBfATRPWSI2+/Ec2jF2lXg5lJrxXnvbAJ4L zqxy+WZeLCYNo58R5D6KIzU2ZoipUquQXtkKPn2H4Q== X-Received: by 2002:ac8:224d:: with SMTP id p13mr54002135qtp.154.1560418378757; Thu, 13 Jun 2019 02:32:58 -0700 (PDT) MIME-Version: 1.0 References: <20190611123101.25264-1-ckeepax@opensource.cirrus.com> <20190611123101.25264-5-ckeepax@opensource.cirrus.com> <20190612152718.GC2640@lahna.fi.intel.com> <20190613084858.GU28362@ediswmail.ad.cirrus.com> In-Reply-To: <20190613084858.GU28362@ediswmail.ad.cirrus.com> From: Benjamin Tissoires Date: Thu, 13 Jun 2019 11:32:47 +0200 Message-ID: Subject: Re: [PATCH v4 4/7] i2c: core: Make i2c_acpi_get_irq available to the rest of the I2C core To: Charles Keepax Cc: Mika Westerberg , Wolfram Sang , Jarkko Nikula , Andy Shevchenko , Linux I2C , linux-acpi@vger.kernel.org, lkml , Jim Broadus , patches@opensource.cirrus.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 13, 2019 at 10:49 AM Charles Keepax wrote: > > On Wed, Jun 12, 2019 at 06:27:18PM +0300, Mika Westerberg wrote: > > 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. > > > > Yeah could be that or just for some reason this isn't returning > the same adev as we previously had. I will do some digging see if > I can find any likely culprits. That was almost the culprit: client is NULL here. So the call of i2c_acpi_find_client_by_adev(adev) fails. I guess this explains why the next commit is also not working :) Cheers, Benjamin