Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1364068ybn; Wed, 2 Oct 2019 15:05:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqybuLP+z0bZw8REEP3Do/+rPncBBIcMHJOACEwBpXBa73yuSEcRelODiMx63uzRKZYFddTL X-Received: by 2002:a05:6402:13c9:: with SMTP id a9mr6219361edx.25.1570053954603; Wed, 02 Oct 2019 15:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570053954; cv=none; d=google.com; s=arc-20160816; b=bebIgWOwWxVT0cx1Y3Z26/YVTFF6fLVqrvQReEdx+1i7AzBwcrKeUrSS1wL6PfGWMb nkLgtx9l08VuJbbi5RpPQA3tgYMzS2oSp4Map6M/VbazaoLPbpAc3DuASkHzofqlp4k2 8q0PqOZQZJJd4TLqmiF17a/XdpkfYfNltuVfOWHrWjoOQqFmoOi0S7OlKgxEHoC2mOcg i05tyvdarqDghIVRvTW6zcdYetXQ7ekEEv3YyV1OeIrvyXknUFWnEh8H8TR7MtbVJSmK kHmXokg5hvnVOinzt9RZ8oZxF/AIyy/UjkekIBPykmWlpv/97njdOf1umWb2m1soWF0B oxAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=YLkP+2lAHWkPfMgk6pb+w4QEvy7mnsmDv74TU3Uz62c=; b=JMTkbyUC2behbT/gzhAsn6IpF303HdsEuuMH/Glj6kK/CeqJ2XA44Uky7KZ/81amfq 2r7M2puVX4mOAmfMIJ5rbDQqnt9sqaDQbmFPlPF5DIwBSvVbdpuPX+L9P9zE2zJjasz9 W+J2ciFl6z8SGZPyVdymusl1l+4o3PzSMGwPJFB4K0DZju/ptQCd82QcXNUTVz4ayjY/ +A325PcxGcQF/qphmTpJZt5e0KE4hdJikjldFhZYRf+ywxDpsqElUF3Gfm+MMAIewEZO vlJnES8OyRSuYD43LKI0eO/ZESOVC+4rtXdHiLB/bq381VsZMW7MnowrSM6JYXAi+ZWc cH+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=IwimoNCr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si184644eju.329.2019.10.02.15.05.29; Wed, 02 Oct 2019 15:05:54 -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; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=IwimoNCr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728072AbfJBWAl (ORCPT + 99 others); Wed, 2 Oct 2019 18:00:41 -0400 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:55483 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbfJBWAl (ORCPT ); Wed, 2 Oct 2019 18:00:41 -0400 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 268A1891A9; Thu, 3 Oct 2019 11:00:38 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1570053638; bh=YLkP+2lAHWkPfMgk6pb+w4QEvy7mnsmDv74TU3Uz62c=; h=From:To:Cc:Subject:Date; b=IwimoNCrsPFplXawmbt8wLuLtStub2nm0qotITdAm+Su6EDzjvmeEwP6xDbE/8knz +VQ16/PSyzdtoU2XwAyc+Eg3gtCcF+eJg7uRWZy84gFAdW0sg2HquLTbZCojqe0Qgg nzpIOifjgsYyYkAbXKBYGCsv7zUPYW8wpJp32ktC3KMvRVunNRLHyrH/EL5vcFzori GtVPv9VjOYkWobRJoWn8U2kVBAtw09eTJQXjQSZZSRrzoefRuqKb/jboBYLKRHAbKc lZI4viHWHZ5fLcDPJuKQNr29s2cTWBaGiZIV+X7ir3dGLqv/f1iLKdJy5fPahDWESA dnTS9t+GzSsDw== Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Thu, 03 Oct 2019 11:00:38 +1300 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.20]) by smtp (Postfix) with ESMTP id B015913EEC9; Thu, 3 Oct 2019 11:00:41 +1300 (NZDT) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id D493228003E; Thu, 3 Oct 2019 11:00:37 +1300 (NZDT) From: Chris Packham To: linus.walleij@linaro.org, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, rayagonda.kokatanur@broadcom.com, li.jin@broadcom.com Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chris Packham Subject: [PATCH] pinctrl: iproc: improve error handling Date: Thu, 3 Oct 2019 11:00:33 +1300 Message-Id: <20191002220034.2034-1-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable x-atlnz-ls: pat Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org platform_get_irq() can return an error code. Allow for this when getting the irq. While we're here use the dev_name(dev) for the irqc->name so that we get unique names when we have multiple instances of this driver. Signed-off-by: Chris Packham --- Noticed this while debugging another problem. drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/b= cm/pinctrl-iproc-gpio.c index 6f7d3a2f2e97..c24d49d436ce 100644 --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c @@ -853,12 +853,12 @@ static int iproc_gpio_probe(struct platform_device = *pdev) =20 /* optional GPIO interrupt support */ irq =3D platform_get_irq(pdev, 0); - if (irq) { + if (irq > 0) { struct irq_chip *irqc; struct gpio_irq_chip *girq; =20 irqc =3D &chip->irqchip; - irqc->name =3D "bcm-iproc-gpio"; + irqc->name =3D dev_name(dev); irqc->irq_ack =3D iproc_gpio_irq_ack; irqc->irq_mask =3D iproc_gpio_irq_mask; irqc->irq_unmask =3D iproc_gpio_irq_unmask; --=20 2.23.0