From patchwork Wed Sep 4 02:09:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1980413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=BYrSPY5J; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=J+LmakVU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wz5Yk5FNlz1ygx for ; Wed, 4 Sep 2024 12:10:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YCuzdeLJMUg1FgXjX9lkzXN/G/tvAmzO8LmX8Bp/CIE=; b=BYrSPY5JN1OliV XxJy4tm9E1CRppEowLFy76+1koM4FQYm4e9F1UsBT6D5auJndov+e3ec0LuJ2I6B735HIQcVQkDCz 4J6+f3zN+AL5kYP1u3ZF/Kkdn2zoVZ4KqBVWQoE86hEUs6pgjbGr+v+IbZRKmnTYDUlDXx4Y4XKGG 14F2jdoEF5t27pnK9iqOlqaS+9LUQKo//qhRucrakscdFDe4QPHQf1hjzUoipVyd/lQ2rDZLm9Vtl cRuV74sWNbI1QU9xn2qIiA8KT88AKUeLb2jWQpN6KM3AXK0hiQx08enyb7YVtt3CQrxpoQv48UjO+ f23b2NqVq2UQlCzULkmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slfTY-00000002YQF-2YSm; Wed, 04 Sep 2024 02:10:28 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slfTV-00000002YPQ-3WUo for opensbi@lists.infradead.org; Wed, 04 Sep 2024 02:10:27 +0000 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2da4e84c198so227825a91.0 for ; Tue, 03 Sep 2024 19:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1725415825; x=1726020625; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PcCch4rmSsYOFwhO35T3y3S2p3vD5etykxg5cC9boXI=; b=J+LmakVUJhrx8u/PmWvaVGcHzAx92TvSl519MIOdfwPT9j5lfX34WcOKmrSx4Fv9Z7 bZlD60xQ8ndj7SBLnuE4r9kOUC4Wrn64/3H86BqRhQ+LJvhOlpsHtgGsX/dWWAATb2zP D8yKJq2od/HJYC2SP8EeKcfmt9dJxgccKaEiROmKhveYABtMvxpQ4EuFbZ1Zr7qAhWHI Blluudz1IBhQrGKAN+Wy77LJWdhdl8DPyyKTKdn6R63t2m4PbIdWVvXDtXDe/YIvubxa 0W8cHDiGiObGia7Oxl/tDZRNDygWK4iDoU+0o7xvIA4M9NTotaNUQxdtuiz22uUyoTuO rbKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725415825; x=1726020625; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PcCch4rmSsYOFwhO35T3y3S2p3vD5etykxg5cC9boXI=; b=BKu4VyQVutBuHv15a69+YoapAdvQxjJPAYY6wDYQ6n8vVMZGPyKV6UjuR2v8uEY2Y5 e41OPFS7gTdHpi0TKfAXn6Q9/BeJHeOwuU/qrMqBK8UuMDcoZRNJ3MEekRMcTDWG+UG3 Z4rSldZNW2+Mk9N3AjG1NlfVdReOu9YHkk/zOm8L24Tp8x6aoPMB55W/VKnHFZtHDQ1h jcqDFppmLpLOq/fXX2I1Slg8sZag8ABqA9zyG7JMHoa8t4hXT+by3EcqU/bJ1KKp7aaT pVCaaQi8yRkI96cs7DfSDBdnp5D4oJ8He1sTIgYGRmpiFmrIZyA5mnsVRoF8fGXeKQJ8 Vv4g== X-Gm-Message-State: AOJu0YyWYWCB27iH4jXNAkpbmFXKDf9xIXv2DgMoRNQg5OAvrPLpbKdb iinuCppxgd8WTE+s5RYhnwFJlLZXGY8r/1xT2l2OLeW0DpmukfuVJZDIlM0bLIjlvyv+i/KwwoV CfM/ydVUiEVy+v1/NcoRUxoSLhi4esfKX2vvmsQFW7+Dg71+YfdXJ5/FLP9IFBAMukEtdYUH10E suR3A1DJHDXmt6YrKxQ8v0q/NYwDqwKrULg81B5k5I0nLWQzhW5Y0= X-Google-Smtp-Source: AGHT+IFbPk5Z9yL5WK93G46i2zCHn9C8YxmzbWSQ1g40/rV0/rXFtMi+X+RCxk+kYtjj/k/le5UVNQ== X-Received: by 2002:a17:90a:8c91:b0:2d3:da6d:8330 with SMTP id 98e67ed59e1d1-2d85617bab4mr21858697a91.4.1725415824657; Tue, 03 Sep 2024 19:10:24 -0700 (PDT) Received: from sw06.internal.sifive.com ([4.53.31.132]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d8af988d0esm6738385a91.45.2024.09.03.19.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 19:10:21 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 1/3] lib: utils/gpio: Remove fdt_gpio_driver() function Date: Tue, 3 Sep 2024 19:09:37 -0700 Message-ID: <20240904021006.3653559-2-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240904021006.3653559-1-samuel.holland@sifive.com> References: <20240904021006.3653559-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240903_191025_897838_0F1465AE X-CRM114-Status: GOOD ( 11.00 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This function looks up a chip's driver by matching known drivers against chip->driver, but that is equivalent to using chip->driver directly. Signed-off-by: Samuel Holland --- Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This function looks up a chip's driver by matching known drivers against chip->driver, but that is equivalent to using chip->driver directly. Signed-off-by: Samuel Holland Reviewed-by: Anup Patel --- lib/utils/gpio/fdt_gpio.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/lib/utils/gpio/fdt_gpio.c b/lib/utils/gpio/fdt_gpio.c index d8d847f1..6422c45f 100644 --- a/lib/utils/gpio/fdt_gpio.c +++ b/lib/utils/gpio/fdt_gpio.c @@ -16,21 +16,6 @@ extern struct fdt_gpio *fdt_gpio_drivers[]; extern unsigned long fdt_gpio_drivers_size; -static struct fdt_gpio *fdt_gpio_driver(struct gpio_chip *chip) -{ - int pos; - - if (!chip) - return NULL; - - for (pos = 0; pos < fdt_gpio_drivers_size; pos++) { - if (chip->driver == fdt_gpio_drivers[pos]) - return fdt_gpio_drivers[pos]; - } - - return NULL; -} - static int fdt_gpio_init(const void *fdt, u32 phandle) { int pos, nodeoff, rc; @@ -112,7 +97,7 @@ int fdt_gpio_pin_get(const void *fdt, int nodeoff, int index, if (rc) return rc; - drv = fdt_gpio_driver(chip); + drv = chip->driver; if (!drv || !drv->xlate) return SBI_ENOSYS;