Message ID | 20210420145058.3934010-2-sean.anderson@seco.com |
---|---|
State | Accepted |
Commit | 430e136dc1398546ad2b1db08692e9edac480cc8 |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=secospa.onmicrosoft.com header.i=@secospa.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-secospa-onmicrosoft-com header.b=xdvp3Kq3; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FPmqK0bm4z9vDx for <incoming@patchwork.ozlabs.org>; Wed, 21 Apr 2021 00:51:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2DF6E82B34; Tue, 20 Apr 2021 16:51:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=seco.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=secospa.onmicrosoft.com header.i=@secospa.onmicrosoft.com header.b="xdvp3Kq3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6370982B1D; Tue, 20 Apr 2021 16:51:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20622.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::622]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 903C782B19 for <u-boot@lists.denx.de>; Tue, 20 Apr 2021 16:51:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=seco.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sean.anderson@seco.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YswyUP2agx5WfnIWFHGRJaIisl2XsDE3LF1agM3SFr7g2QvIwyLttfxqHXVCN09xC4m81JyLpj0+5FKs+RDoJ8CXLgaWJA3KmIU2JG+u4uL49nV660zk4zfk+OCs/2IjOGFhbz3kIepphKY5CYV90uWjp+dV1eb6Kb2EFmuwTBKEQ5687yXRf6bhk+iEFDkfgLtHaHeUqxEFxzVYVr55+3lKwI5+j0FKWM6M1fxL1gE/Yek24M7pkv6y2i+ZbjRdv6ulGJjtdWSphKn25Qriw0CxFMqXVZFKrMs7IZNJupTIqj7sAwrAnqcRRTL3qpTva02mgyFG0wsEOch229s2vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pA1pAILosfnvgWmycfN1fQL27wpfiCDU+HBfs7YHork=; b=A84CsUtSBHk5yAYGpUmoDnjnnUqu4pZ+xd/ach8fnx0GnuRuyoiMTbmzgT7s6eT0vSoY/UCSH/V2Y3SbP1PABbSyw6SNssRFbiKyufwQr34T4URIDQjDCwrGUEf8VSK5ht/2QEbH2RaTsXQ2onoMjYjYuiPE+OKAVmfW8KOy9dkST/PuDuvtH+bNcge4sIfivsdkCTXA+2csLnX/79JQ39sIIl2nLa+hwobkk+TkcNTlqi64MzFCHHy3FFvjEBrrNFT4ZfLFs/yTMZZGSD1NCVPKhZZtG9pB/P4GlJvZnGvF/Zju1p72BIr+KaXW1DEilcUBm8N1gInoXJMCrWpJdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secospa.onmicrosoft.com; s=selector2-secospa-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pA1pAILosfnvgWmycfN1fQL27wpfiCDU+HBfs7YHork=; b=xdvp3Kq3bmTNKKni2pISJwQTe37CoB4v9y2euDWC9OpBtFxIP+DHxcijU/sTUHVDQS/U0oJt10NqWJChIBXhVYYaNen29iiQxFcQFb6Nm/hopI9sGibV0U4WTaIOOMDOTYSu4X1ArLXbdqw04wDUA1MsbPkGEq9qTZ0GVAK+jlg= Authentication-Results: konsulko.com; dkim=none (message not signed) header.d=none;konsulko.com; dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by DB9PR03MB7243.eurprd03.prod.outlook.com (2603:10a6:10:220::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.19; Tue, 20 Apr 2021 14:51:16 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::9181:c45f:b367:9bdc]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::9181:c45f:b367:9bdc%5]) with mapi id 15.20.4065.020; Tue, 20 Apr 2021 14:51:16 +0000 From: Sean Anderson <sean.anderson@seco.com> To: Tom Rini <trini@konsulko.com>, u-boot@lists.denx.de Cc: Simon Glass <sjg@chromium.org>, Sean Anderson <sean.anderson@seco.com>, Heiko Schocher <hs@denx.de>, Jean-Jacques Hiblot <jjhiblot@ti.com>, Patrick Delaunay <patrick.delaunay@foss.st.com>, Pratyush Yadav <p.yadav@ti.com> Subject: [PATCH v4 1/5] dm: gpio: Fix gpio_get_list_count failing with livetree Date: Tue, 20 Apr 2021 10:50:54 -0400 Message-Id: <20210420145058.3934010-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420145058.3934010-1-sean.anderson@seco.com> References: <20210420145058.3934010-1-sean.anderson@seco.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [50.195.82.171] X-ClientProxiedBy: BL1PR13CA0424.namprd13.prod.outlook.com (2603:10b6:208:2c3::9) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from plantagenet.inhand.com (50.195.82.171) by BL1PR13CA0424.namprd13.prod.outlook.com (2603:10b6:208:2c3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.8 via Frontend Transport; Tue, 20 Apr 2021 14:51:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 13542042-ee08-4ba9-5ced-08d9040bc042 X-MS-TrafficTypeDiagnostic: DB9PR03MB7243: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <DB9PR03MB7243349E3B5080BC72FCB89796489@DB9PR03MB7243.eurprd03.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:167; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wirHApDJwGUa//j2FAlhFcr7gmii4ZlU4m8ZHQBtgSI2bYwoHlU2+GHOT75EpnGnkUWS/s2gHY3FbVJi4BeWPI9kh6r006SL2t8S6YcfR3rSzlJoEVLT2HTpY6nPAtdLlYjjHBFrPv/vOfvAfKFemAvzvyDjvbfocMyYXDC8VI2DJ6YRyFasA451ceQWacH3Fcek477LIz9KkgohLgMVdN7s4zQlZe5KQYFS4xbTGdzVbQ/34l8/tXdrLESFWo8/61geg7URNLiyG/FACqSSWRIvDiSJxJfYR503GCw0ODvuoIW/4gFvWcaME/2wMRXBDbxu399im7ezj2337rG7hRgAsCzWY7EVmTU2kR6shpnQrmrCiR8tPIok18wufvAkaXPByMBVfUJVQg2b1QDfhkSoLpH1sJ7ILIyFFb8wVz+ADGJ08jdRBJWQfFjMwOwyomgl1nBI41gBsKHM5FvjF1+e9y6pxc1z1GTHHxFSI33hhjTB7/RM/S/31cePyuAls3i402qk6vMHc/++Jl6vYjtUU4MHi93Pweuep3YR7z7FHR0uKc5i0RX0v6AWnfN8hapsaFL8jXr40qLl6ddwYFeDYU4DxYgYFKKbdjGjIckeinT6wSqe+PMUndH2B5X/4iEry8SRrrDW+7vkAbWNLMU7aTcg8l4ROWC2+a4VIlg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(16526019)(44832011)(498600001)(8936002)(1076003)(2906002)(186003)(6486002)(86362001)(66946007)(38350700002)(66556008)(4326008)(6666004)(38100700002)(8676002)(6512007)(6506007)(66476007)(26005)(956004)(54906003)(83380400001)(5660300002)(2616005)(52116002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: NkixZBSzTniKHHAKUGHrQNFIXLWyNBWp2PgfWZEdUe5CkmOYrLOv+ECdRkFmoGRPHWLktB1YnrwOzImwtSnuY5gJFas2YIq6pAvsM2J71H1B7LqSn41fnvCpAD2KVnAz2OF4KJ1ny7jNT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CcFMMYghJ2k5x72tBdRrIik0O2TZOeBPh/Q7UYTr4oQd0Dzm6AB16lghFctqccUv2ZyN7aXQDB7ZhBwcGN6RPUuJ8evKf2vYyZzUeXQylyQh+SOYrPtg1y3wPgqxPStS X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13542042-ee08-4ba9-5ced-08d9040bc042 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2021 14:51:16.8360 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: K6WWRdv4aFVqM9CuPkndWwgk3poBHn2b8J4WXjcSAMH5/65Axo/Q7Fs8mLJJg51cvxp6iZPRRqpZHV8U6Y1sxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB7243 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean |
Series |
sysinfo: Add gpio sysinfo driver
|
expand
|
On Tue, Apr 20, 2021 at 10:50:54AM -0400, Sean Anderson wrote: > of_parse_phandle_with_args (called by dev_read_phandle_with_args) does not > support getting the length of a phandle list by using the index -1. > Instead, use dev_count_phandle_with_args which supports exactly this > use-case. > > Fixes: 8558217153 ("gpio: Convert to use APIs which support live DT") > > Signed-off-by: Sean Anderson <sean.anderson@seco.com> > Reviewed-by: Simon Glass <sjg@chromium.org> Applied to u-boot/master, thanks!
diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c index e4e7f58c39..131099cc17 100644 --- a/drivers/gpio/gpio-uclass.c +++ b/drivers/gpio/gpio-uclass.c @@ -1215,9 +1215,9 @@ int gpio_get_list_count(struct udevice *dev, const char *list_name) { int ret; - ret = dev_read_phandle_with_args(dev, list_name, "#gpio-cells", 0, -1, - NULL); - if (ret) { + ret = dev_count_phandle_with_args(dev, list_name, "#gpio-cells", + -ENOENT); + if (ret < 0) { debug("%s: Node '%s', property '%s', GPIO count failed: %d\n", __func__, dev->name, list_name, ret); }