Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1010742rdb; Wed, 24 Jan 2024 01:55:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUcYR/XtDrA49FkUmzmuVBrySgM57VHYFI75CI0pJxsnfQ2DUl0iS9joIWu2IEja+yoH4d X-Received: by 2002:a17:902:9005:b0:1d5:ee6d:9707 with SMTP id a5-20020a170902900500b001d5ee6d9707mr371946plp.92.1706090157215; Wed, 24 Jan 2024 01:55:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706090157; cv=pass; d=google.com; s=arc-20160816; b=GqEsecLy5cGLSbc8erp5mJFf07fTc5fVlB/AP1KaPQhk1C9VQFkWMVtq5pcpNBW9O0 2kEkPnECCzt6y19uFAzgOhTcr4hkTpemCGshnyQd8AfEo/W9jWI/f01i6I8dsJE5DOLt 2Rgvelq97SNLa5lmY9aKXyits+/ylDQW43FmZkbFEK0EfV6dRYmBoPBr7nL4Dv4RFxH9 /lGFfSVdNfeU4KxzrkVC47UCOCZWdb2txP5OUf6oOwekUm5yCRV8GnTWzRmSbiou/jBD 1LGzu3XaCYoSyzuu0Ho54jUTCZVR90l9ysDTNfNpC8avhSSTgM7sdB4VAdCnPhKkrkxE 19pQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id; bh=MVz3EFiZwptGuRrH9mgFvWnTx/jF65+A4mxdOk0qA70=; fh=awuZRfY8N+FtdKkr+Dd/v9jO+8q61jXgzz0Spkume/A=; b=I8owuV/cJEaiUhM2v8mbEf5b4fEawUyPjqXkV4pLbo3wF9jj4n/NlyHWI2e7SI/Ynd 4ywEuqLEMG1VJnX92lYG/0aN67dnRPbuteGaCe2fZocGpaJ33GkLNZtFU1z1pNILiK/Q x15hgjBit6aD7HFFDHzOoogXqRJXLDjRQZCbOexSHfoCIe7oIVCbtyovMh8Kkh9mPdOm YpHP9SH1hsdpGS5px7n6+fHeYS10qVZRKG2MdIS7+59pBH6bc91i+AdOq5pKe5GFiPld CAKd+okDQrQoDjudFAGJtcTKO2YyLajz86g0tBd6By+M7cIZ8kKDOAxjRfdcjfkebkKh vxow== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-36751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36751-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u6-20020a170903124600b001d75d64b2absi4181113plh.1.2024.01.24.01.55.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 01:55:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-36751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36751-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 05EDA28F388 for ; Wed, 24 Jan 2024 09:54:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CAEBE18622; Wed, 24 Jan 2024 09:54:08 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70B30182C3 for ; Wed, 24 Jan 2024 09:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706090048; cv=none; b=iVQ8QvAHNtEJDr9BBJS17vC6iaYe/IfLhnzf4vloJR/a5fLfV6Wq3Q+huk5B6IfWgW0JJFrXLNi3I0MxJ6Y0nOXEKjgWsGThPau65Hbf387BMPljxcGRHFAWPn9C/hBAZiBeEdHLKJdXDjBhTG0ZubnuLV5OEEKTDCEPxQZLbhM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706090048; c=relaxed/simple; bh=bBQz4OTYCWei7l4zTOrS5Adh5pXLDEyLA6TLAKN59PU=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=cNQ3wk+t/vnfTNRAoEYufehpIm1ksSe3AgKUS+MQIKA2r9gI4ga8L1RiJJtJnzVaBoYFRStPDsY2SPJ8gcY7RmKQZ83oCwgykKw+GpZeUaQP9gYdwjtB/KW1hfMfdEwNi1nr/Btn+cLqiZdpW7wIn1jFtHTCe5CPcOsa6q4/M8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rSZxE-0004u2-1P; Wed, 24 Jan 2024 10:53:56 +0100 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSZxC-0021lZ-3y; Wed, 24 Jan 2024 10:53:54 +0100 Received: from pza by lupine with local (Exim 4.96) (envelope-from ) id 1rSZxC-0006Io-0A; Wed, 24 Jan 2024 10:53:54 +0100 Message-ID: <31bbe5787708b7de770cab96a9072fe6db39347b.camel@pengutronix.de> Subject: Re: [PATCH v1 2/2] irqchip: Add StarFive external interrupt controller From: Philipp Zabel To: Changhuang Liang , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Ley Foon Tan , Jack Zhu , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Date: Wed, 24 Jan 2024 10:53:53 +0100 In-Reply-To: <20240111023201.6187-3-changhuang.liang@starfivetech.com> References: <20240111023201.6187-1-changhuang.liang@starfivetech.com> <20240111023201.6187-3-changhuang.liang@starfivetech.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Mi, 2024-01-10 at 18:32 -0800, Changhuang Liang wrote: [...] > diff --git a/drivers/irqchip/irq-starfive-jh8100-intc.c b/drivers/irqchip= /irq-starfive-jh8100-intc.c > new file mode 100644 > index 000000000000..be8224111cf2 > --- /dev/null > +++ b/drivers/irqchip/irq-starfive-jh8100-intc.c > @@ -0,0 +1,180 @@ [...] > +struct starfive_irq_chip { > + void __iomem *base; > + struct irq_domain *root_domain; > + struct clk *clk; > + struct reset_control *rst; Since rst is never used outside of starfive_intc_init, there is no need to store it here. [...] > +static int __init starfive_intc_init(struct device_node *intc, > + struct device_node *parent) > +{ > + struct starfive_irq_chip *irqc; > + int ret; > + int parent_irq; > + > + irqc =3D kzalloc(sizeof(*irqc), GFP_KERNEL); > + if (!irqc) > + return -ENOMEM; > + > + irqc->base =3D of_iomap(intc, 0); > + if (!irqc->base) { > + pr_err("Unable to map IC registers\n"); > + ret =3D -ENXIO; > + goto err_free; > + } > + > + irqc->rst =3D of_reset_control_get_by_index(intc, 0); Please use of_reset_control_get_exclusive(intc, NULL) instead. > + if (IS_ERR(irqc->rst)) { > + pr_err("Unable to get reset control\n"); > + ret =3D PTR_ERR(irqc->rst); Consider printing the error code via %pe. regards Philipp