Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp159729lqp; Mon, 10 Jun 2024 23:41:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWE3E2AfFVCqNHq3IBLhMsobb1Fi/9faxMLi0i4JsAJCg+MRAYDipqungy68WOGVYhB9paGwHWiXlGCEsY8V3CKrovxTiN8awuP0Dsd4Q== X-Google-Smtp-Source: AGHT+IG/8cqiYK63qwC/GVep5KLwhTF0wTMvEIz6WbKwLg8YmZQjsoA4JWsoVDeGz45O6KOlkswZ X-Received: by 2002:a05:6a21:33a8:b0:1b5:69cd:87e with SMTP id adf61e73a8af0-1b569cd0967mr8226000637.21.1718088068044; Mon, 10 Jun 2024 23:41:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718088068; cv=pass; d=google.com; s=arc-20160816; b=YyCr2xlrYo0RMOEJZN2nhEMkYo+MohJCt2AbCrF+/lBNHA9d2SrB6I6IZ+E+ra2K8b SBTxV+ngyEZ6TAmfYZDe/BkftQXoak92drAMn77RGxfhjNQ40/mpezu4dbmZluPpke5v cau+xfot/IUl9YuO5VozuwoMaCsICxSpHxkXG41lzgQd0NlQ1ljH8YK9I5bLZhVP0y1F fAIOAKdNZ2G4HBKDRptY5fwJXSWGMOW5djJBlhtHMUf7GzsCRm+gnWPGhdPSaiKa6afL 4TONyMlfvij2D1yftu0X/EV01PLrMW1ag75qHGiWe+qkwV9Q13cO6uOCiYvJ+TT4jQmA 6UQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rW+1bWfOjK8LklAi5rLMDUblTYcqO24dKWlfvRIgaZY=; fh=mOPQ3DD8EqBi7eIMGv0JQrjOlxZkXPoiANuQ3Vg/qYk=; b=Nw809ItqlY89a4fm1nW8PatGvu6jGGOkv9ZZRvKHHrH3GlLhRQM2DwkZVexDosZ62p ISBal2SXl9L1WYMQJSL/iDbgOj9cJvS0UV7eXPAFzotzJogYgCI5Auo0H/PydNaFczSZ 1SfGO+ogLTsxo6FBMJ63fxKce9iED7B9Gz3nJ8U8lrIsSdQXVyX3O0YqoGG7Frj8KuQx irzKBvAO8GlD8K5Q/NqoAwyHyBKceybR+8DSBT/EAnJmFgBsnQUJOaYkCnvjTjXlzQZw 2SQf4AQ3/0mTNLyuMb+3DRmv0mKRNpkWswipQpQ1a+sZqmXWth8015AMxpQjTPep3eYI eDOw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=IWyXzCkV; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-209309-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209309-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-7059b8f689dsi2546821b3a.184.2024.06.10.23.41.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 23:41:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209309-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=IWyXzCkV; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-209309-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209309-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 73295B2AB74 for ; Tue, 11 Jun 2024 06:16:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 429A5171098; Tue, 11 Jun 2024 06:15:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="IWyXzCkV" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 CA5A1A2A; Tue, 11 Jun 2024 06:15:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718086554; cv=none; b=otIcgepMiyCiCBKLKQKe+uoa1bkguWVMnctec2Uufw78K4pX3iP1xgSXRLltUV/Jmmz2SJ7kdyTROSNsVMV1B+xSCekuqTAF81s1nOlQCNLbDdX6DgmyrauRFx1mLz5rGnoJ4HkxE0BjxnpTOwav9uPl3OfK8hFlJFSya8obgFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718086554; c=relaxed/simple; bh=lloR2gbqxT2zZLt7BjL1hwfSkhWDcrB89RKDxRxLMow=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BMLJ5UF1z6I7Bm7VQqwmYYPlxhJjS4FP3zyJD8gosSza43TAIU2JvKzmCwmRaGQNgSz+Lerh9pvk1Bp/4BTAAEpsReBkDIchKWmWE2OVxX3A5TfczrENzjxbeimwL90Tnn87tFZhfoJzqDfm1HGVZ7Zc6P5u4A4g92M3HD12dnQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=IWyXzCkV; arc=none smtp.client-ip=198.47.23.249 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45B6FjEE123312; Tue, 11 Jun 2024 01:15:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1718086545; bh=rW+1bWfOjK8LklAi5rLMDUblTYcqO24dKWlfvRIgaZY=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=IWyXzCkV+gdrroEyemV28abeEAboGTyRf1vPNNWBfAqkZiSo3hLHaEaLyF2NoySfv pSGxKjjJ0qvIOqZHtuJyGx73blIONVZJJqR2JYQY0oC93qLvuk+XQxnvYsdGsNVzLW BaPV7XON4qNAj3lgbLrUVIAPnKLm4i0QACQRnRGU= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45B6Fihl028990 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Jun 2024 01:15:45 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 11 Jun 2024 01:15:44 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 11 Jun 2024 01:15:44 -0500 Received: from localhost (dhruva.dhcp.ti.com [172.24.227.68]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 45B6FhHU060985; Tue, 11 Jun 2024 01:15:44 -0500 Date: Tue, 11 Jun 2024 11:45:43 +0530 From: Dhruva Gole To: Andrew Davis CC: Sebastian Reichel , Florian Fainelli , Broadcom internal kernel review list , , , Subject: Re: [PATCH 3/5] power: reset: brcmstb: Use syscon_regmap_lookup_by_phandle_args() helper Message-ID: <20240611061543.jivkvda6hhsyv4xu@dhruva> References: <20240610142836.168603-1-afd@ti.com> <20240610142836.168603-3-afd@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240610142836.168603-3-afd@ti.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Hi, On Jun 10, 2024 at 09:28:34 -0500, Andrew Davis wrote: > Simplify probe by fetching the regmap and its arguments in one call. > > Signed-off-by: Andrew Davis > --- > drivers/power/reset/brcmstb-reboot.c | 22 ++++------------------ > 1 file changed, 4 insertions(+), 18 deletions(-) > > diff --git a/drivers/power/reset/brcmstb-reboot.c b/drivers/power/reset/brcmstb-reboot.c > index db5b7120eadd0..94ea317f61ef4 100644 > --- a/drivers/power/reset/brcmstb-reboot.c > +++ b/drivers/power/reset/brcmstb-reboot.c > @@ -18,9 +18,6 @@ > #include > #include > > -#define RESET_SOURCE_ENABLE_REG 1 > -#define SW_MASTER_RESET_REG 2 > - > static struct regmap *regmap; > static u32 rst_src_en; > static u32 sw_mstr_rst; > @@ -87,6 +84,7 @@ static int brcmstb_reboot_probe(struct platform_device *pdev) > { > int rc; > struct device_node *np = pdev->dev.of_node; > + unsigned int args[2]; You can also call it syscon_args, but I'm fine either way. > > reset_masks = device_get_match_data(&pdev->dev); > if (!reset_masks) { > @@ -94,25 +92,13 @@ static int brcmstb_reboot_probe(struct platform_device *pdev) > return -EINVAL; > } > > - regmap = syscon_regmap_lookup_by_phandle(np, "syscon"); > + regmap = syscon_regmap_lookup_by_phandle_args(np, "syscon", 2, args); > if (IS_ERR(regmap)) { > pr_err("failed to get syscon phandle\n"); > return -EINVAL; > } > - > - rc = of_property_read_u32_index(np, "syscon", RESET_SOURCE_ENABLE_REG, > - &rst_src_en); > - if (rc) { > - pr_err("can't get rst_src_en offset (%d)\n", rc); > - return -EINVAL; > - } > - > - rc = of_property_read_u32_index(np, "syscon", SW_MASTER_RESET_REG, > - &sw_mstr_rst); > - if (rc) { > - pr_err("can't get sw_mstr_rst offset (%d)\n", rc); > - return -EINVAL; > - } > + rst_src_en = args[0]; > + sw_mstr_rst = args[1]; Reviewed-by: Dhruva Gole -- Best regards, Dhruva