From patchwork Mon Sep 30 14:48:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13816577 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5AAFECE8356 for ; Mon, 30 Sep 2024 14:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=5JPVDbbNqioPx5PpN9QQ9QHeM55uETxow7YFSewChHo=; b=kGprpwpZ1QQxDTE9sfxzvrfQlA ewnZVJIo5l1sjjl8uuORD+XubACWGIU9G3CBBqs69EUtLSTARarQ7nMPnDHdNFw7ToRQGuLaSfOOW Njy8GpZK3rnZAReVDIrGcPgUMiO9Gs+V9OACVXvI9FjSt31TjMhbnzJNnNuuUNpnE2qOg7wPHjPJX TLyc4uzvBZYyMKW8ytF5iQ/1twn5HzgyQYd4twPCYoflvwIbm1fu6ke30djNU3Z3JDDez62P/FllM HOn1SKKP/+7Qrads+ap8CsvZJyjtAorJvLtpQ/zD5ZSxeSzUmE62zxYPKohS7/FfePlFX8y1yVHOq aJm5eacA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svHlg-0000000HZSb-3fC6; Mon, 30 Sep 2024 14:52:56 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svHhC-0000000HYRt-3KGN for linux-arm-kernel@bombadil.infradead.org; Mon, 30 Sep 2024 14:48:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=5JPVDbbNqioPx5PpN9QQ9QHeM55uETxow7YFSewChHo=; b=pWskqnXIZtaxHZ36ZqiuOoUdxu ibcmg5oumvBKVQzpe2XuMQGaHs1UtrHOqNtmVWJr8o8P5ckYhySfynDrzQ/ikXIw2tKO4hP6ryyc5 yNkJWnVES2L+0hHSToePGTI9OAPUyBlU6rPDf/yE4ypxQ9Blasi8XWkGFD8K3hSm1/kXFUe6K2AVI lsrbtRxtnKEgX/lUbS/4mNp+dtuKb3BFFY4eZcAmSUdB8rkY9HKmw8zcjXrnnf3rcJ8c3R+VlCK1Q 7O0Zsjhy2kBJV5SccWpaxM5l/yfhAaOkYGvdoRnAB2KLkMC88n1HGPoyMbtADKtWAMxdB0kg/rSxJ HoiTVSRQ==; Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svHh8-00000002qau-2wcp for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 14:48:17 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42e7b7bef42so36191245e9.3 for ; Mon, 30 Sep 2024 07:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1727707691; x=1728312491; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5JPVDbbNqioPx5PpN9QQ9QHeM55uETxow7YFSewChHo=; b=rMpHLhvdNyIedAloTOKc5wGhlyQFiamQRwiWVWcjCXti61+cbq0tmbPWBvwC73pJNO FyYK/QOk6anN/Ao+ksLtOON8vdfOnmdmV84y+Y8zbeu64QOsI3PV0mYCDpHACRIOTpx0 bg0DR8VloiYoPrTCmk/7cKPiGPSTPvFC8ZR9IjQ76adC/BWhIvCQHR7AijjXJT5a1aKV PgoqoB3nGyM6p4DpTam/w06LNPa4Ny9dH+dqsKV/LrkyPQo5wvN5lcXFqkpXOdDOkuCn WV02pMUM72stTuqsDcfq0C7NGomML0ARWxKwe2SNQg1VKhHipVM41Cr4ArYvw0kHuppD IDTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727707691; x=1728312491; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5JPVDbbNqioPx5PpN9QQ9QHeM55uETxow7YFSewChHo=; b=DG9mLK6Z5nsEMjdsuWIjORadFEF9oW0ca3kopxVbmGEW/yrV0nkvWhebUiWoX8/X6Y 8Ax80vmkCCro+jmwtQcKJcZMqRt2qNyPo8x9W4kDUnPkrFWyBLFDDIxg05YYuGVjguvO 9LBEc2jO5yF8ASDL2a2pnZ/V2TZII92kyq3sCxfGjO7wuEGkHjDRwG3sbQTOn9Ipm91M QFKXQbwxII9GOdDbd869qTbQo567Z/L69a6RykibvqNbv9g8TTqGoqjI/aolpIGc0817 LFM/Ks2tnbhdtoFj09DgBvT/jmKnQcG0pQbEhsaKju0/lA6DgKEnnlvPMFitSG6UFVHt 3fFw== X-Forwarded-Encrypted: i=1; AJvYcCVrQ/dmoTeaJvC5WnvBPXzq/z2kEm3u+To2B7hBM0+EAAZWK4C6ERka+TUulYIK2rajk4nqHGvDD+4ofddw0VtI@lists.infradead.org X-Gm-Message-State: AOJu0Yw6Rsw+7G1T3QAZ16moPjOW+1Nb6jOhjOehr1OO6OASwJaRXaiD FWkQV6g+ThPG5ei+RfiLYulEWVKjGBerTqMm1ZRFJMY1tHNxy9NTmUZ1N0H/Adg= X-Google-Smtp-Source: AGHT+IHEBWsgzN+e1E83ihM7s8lCg7F/C4ranxA5EM4TGZYF65BQAsQ7T5R0fceezMF+TXipft52dQ== X-Received: by 2002:a5d:4572:0:b0:37c:d183:a8f8 with SMTP id ffacd0b85a97d-37cd5a82669mr6394506f8f.19.1727707691355; Mon, 30 Sep 2024 07:48:11 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:8791:e3e5:a9ca:31a6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd566a41fsm9241505f8f.45.2024.09.30.07.48.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 07:48:11 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 1/3] gpio: xilinx: drop dependency on GPIO_OF Date: Mon, 30 Sep 2024 16:48:02 +0200 Message-ID: <20240930144804.75068-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240930_154815_005990_BD2AF302 X-CRM114-Status: GOOD ( 10.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Bartosz Golaszewski This driver doesn't really depend on gpiolib-of being built and can be compiled without it. Signed-off-by: Bartosz Golaszewski Acked-by: Michal Simek --- drivers/gpio/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index d93cd4f722b4..0d676c96b72d 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -796,7 +796,6 @@ config GPIO_XGENE_SB config GPIO_XILINX tristate "Xilinx GPIO support" select GPIOLIB_IRQCHIP - depends on OF_GPIO help Say yes here to support the Xilinx FPGA GPIO device. From patchwork Mon Sep 30 14:48:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13816575 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B5A7CE8356 for ; Mon, 30 Sep 2024 14:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TKBnQ9A5YYf2FUXo4R11RKTG90nbTdsrzyW+p16FTYQ=; b=LRIkvaQP0yEbk9jey/TTCsWTTd is+XN0+jcYRtft4uQrcRgfkpNLu17IY4ILKTBsQ2Tx5OXZhib5mDVkNFG9gj2jtdCtOdjszz9D2W4 z5LkQLSg8QGsZCaSpy/QC0Q9oDRvVMuZLJDHKsxtzjHONSCNIz+EGziN07/E/2VtoelBGon+bh0GI 5F5QyXS4DWRaI5MSfJtwd95zcKR+iM9EvakDSmWk9HBhxHzQ9TG/b3fYkKbAQf/AOOfOyzoPdECus Z1oD3YsXeXwMJr9Fx7i05a6j961dvI6dL/8DMptnNzF8jwuXZEe39RrnR4//jngM03/7mDlUYJg8i eTELbN6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svHjK-0000000HYwH-20OU; Mon, 30 Sep 2024 14:50:30 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svHh8-0000000HYPr-0xey for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 14:48:16 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-42cafda818aso43008765e9.2 for ; Mon, 30 Sep 2024 07:48:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1727707692; x=1728312492; 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=TKBnQ9A5YYf2FUXo4R11RKTG90nbTdsrzyW+p16FTYQ=; b=SYQPuN8LGdo+Hsx2pHErCWJot8ZQ4gy+RFNPdTegHf2mPkjI60/msJopXvgqdGu6S8 7sdEXpjYEMRrRS3rhuf5iuJX2QA8hTu5ooEMuOxNLubMUvsf7u2ZvKGpkr267wRA21lN 5Xv+AfpXENZEjW86qQVX7v0pv/Bmk15JdcornN1E3Jp/9xpsXFacR2qAB77jsy7ptrwx Epdtc8lXRmH4mqgyih/ySzJDik//XKwT95/4TO6HedIvVkEmAQRfqcUHsnvg96SfUNnh vINv6JICUc2IIn52SNZVxw4Hjrh1yntNv84SX41r4RW8PlndKXBvi2sRjAP9PEG9C9Ui TBUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727707692; x=1728312492; 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=TKBnQ9A5YYf2FUXo4R11RKTG90nbTdsrzyW+p16FTYQ=; b=sml/RAoHFKo/TpDBOCpb3R137iZ5LOwojK5ynC1i1OKAQojoCCw2wJ3KE2+ycO5F6H QYsvkW/iBNyHGLIVObKTsygOoxxjvmPzw6Ns3X9ZoUlRUz9CeQx17kfi7rLIbKh/+Ol5 V3fy85/1clG2ALYVUtV9P7kHCvlQKtVemyM0YTu/I91vKw74Z+l79HBaqdi5PIWZ27zA ZJTUp/BFzKmcBCKHFvpcC06p4JSHXjsggoaA92+GuuUkI+KhfifEuDEZM/pFBk03TgLw IsXUTdnUMMNwoArE+z8cggOmHZO01TSyWa2vHWR0oO6pgz4WVQ9anFzxcXPXQiBnBZm2 svKQ== X-Forwarded-Encrypted: i=1; AJvYcCWr0VmQdM5Gxo7vtjYucfyqMFd695Bi0U2vtPVhuv6n/daiyXGJei8pymFTCFsqmAR8+asQ+XY9a4OseFb8YTys@lists.infradead.org X-Gm-Message-State: AOJu0Yx7BEa7kQb5mil6mf3JatcV0wGVRjXcncsEgWMJLJqiuNTzq3/X A8f8k9a1JinRsaW6rWfCMOH1Yie6cMl4MzLA8Ta70OsObO5KNby+JVyaXSFvyL0= X-Google-Smtp-Source: AGHT+IH4juMB4VpfWquIbAxYYFepSx6InHOYaJpHPC7iDAq1R8QsT1e8M8xtsnfnrYxRu0Q9od2aPg== X-Received: by 2002:a05:6000:d46:b0:374:c64d:5379 with SMTP id ffacd0b85a97d-37cd5acbd4cmr7667839f8f.27.1727707692023; Mon, 30 Sep 2024 07:48:12 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:8791:e3e5:a9ca:31a6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd566a41fsm9241505f8f.45.2024.09.30.07.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 07:48:11 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 2/3] gpio: xilinx: use helper variable to store the address of pdev->dev Date: Mon, 30 Sep 2024 16:48:03 +0200 Message-ID: <20240930144804.75068-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240930144804.75068-1-brgl@bgdev.pl> References: <20240930144804.75068-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240930_074814_501051_1EB66FD9 X-CRM114-Status: GOOD ( 16.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Bartosz Golaszewski For better readability don't repeatedly dereference pdev->dev but instead store the address of the embedded struct device in a local variable in probe(). Signed-off-by: Bartosz Golaszewski Acked-by: Michal Simek Reviewed-by: Linus Walleij --- drivers/gpio/gpio-xilinx.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index afcf432a1573..d99824d42c77 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -561,9 +561,10 @@ static const struct irq_chip xgpio_irq_chip = { */ static int xgpio_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct xgpio_instance *chip; int status = 0; - struct device_node *np = pdev->dev.of_node; + struct device_node *np = dev->of_node; u32 is_dual = 0; u32 width[2]; u32 state[2]; @@ -571,7 +572,7 @@ static int xgpio_probe(struct platform_device *pdev) struct gpio_irq_chip *girq; u32 temp; - chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); + chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL); if (!chip) return -ENOMEM; @@ -624,7 +625,7 @@ static int xgpio_probe(struct platform_device *pdev) chip->gc.base = -1; chip->gc.ngpio = bitmap_weight(chip->hw_map, 64); - chip->gc.parent = &pdev->dev; + chip->gc.parent = dev; chip->gc.direction_input = xgpio_dir_in; chip->gc.direction_output = xgpio_dir_out; chip->gc.get = xgpio_get; @@ -633,21 +634,21 @@ static int xgpio_probe(struct platform_device *pdev) chip->gc.free = xgpio_free; chip->gc.set_multiple = xgpio_set_multiple; - chip->gc.label = dev_name(&pdev->dev); + chip->gc.label = dev_name(dev); chip->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(chip->regs)) { - dev_err(&pdev->dev, "failed to ioremap memory resource\n"); + dev_err(dev, "failed to ioremap memory resource\n"); return PTR_ERR(chip->regs); } - chip->clk = devm_clk_get_optional_enabled(&pdev->dev, NULL); + chip->clk = devm_clk_get_optional_enabled(dev, NULL); if (IS_ERR(chip->clk)) - return dev_err_probe(&pdev->dev, PTR_ERR(chip->clk), "input clock not found.\n"); + return dev_err_probe(dev, PTR_ERR(chip->clk), "input clock not found.\n"); - pm_runtime_get_noresume(&pdev->dev); - pm_runtime_set_active(&pdev->dev); - pm_runtime_enable(&pdev->dev); + pm_runtime_get_noresume(dev); + pm_runtime_set_active(dev); + pm_runtime_enable(dev); xgpio_save_regs(chip); @@ -667,8 +668,7 @@ static int xgpio_probe(struct platform_device *pdev) gpio_irq_chip_set_chip(girq, &xgpio_irq_chip); girq->parent_handler = xgpio_irqhandler; girq->num_parents = 1; - girq->parents = devm_kcalloc(&pdev->dev, 1, - sizeof(*girq->parents), + girq->parents = devm_kcalloc(dev, 1, sizeof(*girq->parents), GFP_KERNEL); if (!girq->parents) { status = -ENOMEM; @@ -679,18 +679,18 @@ static int xgpio_probe(struct platform_device *pdev) girq->handler = handle_bad_irq; skip_irq: - status = devm_gpiochip_add_data(&pdev->dev, &chip->gc, chip); + status = devm_gpiochip_add_data(dev, &chip->gc, chip); if (status) { - dev_err(&pdev->dev, "failed to add GPIO chip\n"); + dev_err(dev, "failed to add GPIO chip\n"); goto err_pm_put; } - pm_runtime_put(&pdev->dev); + pm_runtime_put(dev); return 0; err_pm_put: - pm_runtime_disable(&pdev->dev); - pm_runtime_put_noidle(&pdev->dev); + pm_runtime_disable(dev); + pm_runtime_put_noidle(dev); return status; } From patchwork Mon Sep 30 14:48:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13816576 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5FAB1CE8355 for ; Mon, 30 Sep 2024 14:51:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HfRPqMQ2YRL7cytKg67BDcrJy4YgVjPhIG+hcafClNU=; b=oKrCkYA6WXQdkvtkcV0bAbugAT lO9KlnsP1E6NaJc15eYsfTyYFiKMuTZ8RLQZuZCv/ruozmSs03FuOrdC25iJg5Slrc6sgWptmIcY+ UM+h96g8ELfge01pCdhtd2jiD6qyi4mz3DTV8sDimvEpaqW/GvelPTd6/kSTaGkiDlbitEoyZuYok fL/i7G9UN57Ow89vAgIKpyr32MYJVZsp3hSaR7rho5KwEQJv8f7UXwzEFxalvCS1RCDJXXCaoa4YB ak6s8PXPxwRJwL15TRl+541e0mM9QuS4erf1oJZEM7UhMbPih0Rmc1qCIg2tWiLfFltR05jyKm8er YeJ96eUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svHkW-0000000HZEA-0VUr; Mon, 30 Sep 2024 14:51:44 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svHh9-0000000HYQK-2AC0 for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 14:48:16 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-37cc5fb1e45so2964996f8f.2 for ; Mon, 30 Sep 2024 07:48:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1727707693; x=1728312493; 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=HfRPqMQ2YRL7cytKg67BDcrJy4YgVjPhIG+hcafClNU=; b=qwjUsTFMrtsq8U6guCUYBMRL/P/elj6RDwgbBHvicbL9ZGpsMs34my+RMw3ytyr9sR lIYSLc/IGX0xS8HDGqSHzXvyYEMD+yfgJr0PlH2xlo/zrbMO06VUUVTcIeThJh2B63y/ pH33JD1dbBjsya0VCdb3JtDJ91635AOBvJOGYtB4ssB2iPKbxYrRVSiihhHSKaD3Idj6 69BT984Rsxfh5XUqInD1iJsGsUM6KcfbBtPqq3yHmeNcBNgJUUeoJBn8WJjipIg4+B3K lxzEMu/khiSqbuycD7jZ6Bga+HBZH0ITU225jXvo0Felb13oCPG11skRQxVm35jrbAUD LLEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727707693; x=1728312493; 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=HfRPqMQ2YRL7cytKg67BDcrJy4YgVjPhIG+hcafClNU=; b=rmKtKMKdkGxPhffGdwKYExbHkoIIN22kU7cVD30gDKJ9XoxVJUN88k2hsgSNdEOl/E kNfH/RzXavFKP2FUIgVIZbKmnzCia7l09XkF522DNamVIjWWTvQh3tdadF/+PrP3oTB8 EkijEAvZuaQpnUJz6xcOBWPsTSpoNzYRjVHbcig65Msgnnky3T6+sz17adbA1hQUrIOQ TbWe4QY23h5yIyx948zVOabzPDU2N7XzXkOZCNkOdlq/O2ofku/TqVz698prnGs3IXOF /uQZB4nSvB6m7FT8Bozwlcgjln/mzSfN+bV0bCfSzNT4tmtTg7vUMk8ooNLuy8sWh+Ng HDAA== X-Forwarded-Encrypted: i=1; AJvYcCVokbbL584IJzB7e/aKjeEwYAGIieZLXharp1G+F1hOy8eT6rfxUXJvv1CG+rPM7lcNM/rDT/Vbf6AzXpYcdJZ9@lists.infradead.org X-Gm-Message-State: AOJu0YxQffk3RVWWVwGQ1YkmuJ0Wwp9TTzAAXX62lHcfmi6vZNvQidwZ o5Xn44pxBYTyOV/jyGmFE59DdLVmYctdT7z7zE/I3a7XQ0i5cuuv4e0bA7b3UzE= X-Google-Smtp-Source: AGHT+IFS82UmXpIStxa6SqM6CC7PH3OIn3uYOLSrafHNIkj5K/JZaHIK6K+sosLECIqdEFs+/WLaOw== X-Received: by 2002:a5d:644c:0:b0:37c:c4b4:339e with SMTP id ffacd0b85a97d-37cd5acba99mr8323137f8f.25.1727707693439; Mon, 30 Sep 2024 07:48:13 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:8791:e3e5:a9ca:31a6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd566a41fsm9241505f8f.45.2024.09.30.07.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 07:48:12 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 3/3] gpio: xilinx: use generic device properties Date: Mon, 30 Sep 2024 16:48:04 +0200 Message-ID: <20240930144804.75068-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240930144804.75068-1-brgl@bgdev.pl> References: <20240930144804.75068-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240930_074815_591040_EC50C544 X-CRM114-Status: GOOD ( 17.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Bartosz Golaszewski OF-specific routines should not be used unless necessary. Generic device properties are preferred so switch to using them in the driver code. Signed-off-by: Bartosz Golaszewski Acked-by: Michal Simek Reviewed-by: Linus Walleij --- drivers/gpio/gpio-xilinx.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index d99824d42c77..41c552a58059 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -564,7 +563,6 @@ static int xgpio_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct xgpio_instance *chip; int status = 0; - struct device_node *np = dev->of_node; u32 is_dual = 0; u32 width[2]; u32 state[2]; @@ -579,7 +577,7 @@ static int xgpio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, chip); /* First, check if the device is dual-channel */ - of_property_read_u32(np, "xlnx,is-dual", &is_dual); + device_property_read_u32(dev, "xlnx,is-dual", &is_dual); /* Setup defaults */ memset32(width, 0, ARRAY_SIZE(width)); @@ -587,14 +585,14 @@ static int xgpio_probe(struct platform_device *pdev) memset32(dir, 0xFFFFFFFF, ARRAY_SIZE(dir)); /* Update GPIO state shadow register with default value */ - of_property_read_u32(np, "xlnx,dout-default", &state[0]); - of_property_read_u32(np, "xlnx,dout-default-2", &state[1]); + device_property_read_u32(dev, "xlnx,dout-default", &state[0]); + device_property_read_u32(dev, "xlnx,dout-default-2", &state[1]); bitmap_from_arr32(chip->state, state, 64); /* Update GPIO direction shadow register with default value */ - of_property_read_u32(np, "xlnx,tri-default", &dir[0]); - of_property_read_u32(np, "xlnx,tri-default-2", &dir[1]); + device_property_read_u32(dev, "xlnx,tri-default", &dir[0]); + device_property_read_u32(dev, "xlnx,tri-default-2", &dir[1]); bitmap_from_arr32(chip->dir, dir, 64); @@ -602,13 +600,13 @@ static int xgpio_probe(struct platform_device *pdev) * Check device node and parent device node for device width * and assume default width of 32 */ - if (of_property_read_u32(np, "xlnx,gpio-width", &width[0])) + if (device_property_read_u32(dev, "xlnx,gpio-width", &width[0])) width[0] = 32; if (width[0] > 32) return -EINVAL; - if (is_dual && of_property_read_u32(np, "xlnx,gpio2-width", &width[1])) + if (is_dual && device_property_read_u32(dev, "xlnx,gpio2-width", &width[1])) width[1] = 32; if (width[1] > 32)