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: 1991056 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; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=jWX/7Qvc; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.199.223; helo=ny.mirrors.kernel.org; envelope-from=linux-gpio+bounces-10577-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XHPBt6LNyz1xsc for ; Tue, 1 Oct 2024 00:50:46 +1000 (AEST) 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 112711C23477 for ; Mon, 30 Sep 2024 14:50:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2941E1991C8; Mon, 30 Sep 2024 14:48:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="jWX/7Qvc" X-Original-To: linux-gpio@vger.kernel.org Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B10D192B89 for ; Mon, 30 Sep 2024 14:48:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727707695; cv=none; b=V+Hm5XPTB5DH8atjM+Gd/nrDt5ljbYMh7fW3obNmzCDzg7uDMhtAxGifdb5FOtsJUoDFw2OO5ic1LA8VJHUUwVBl/QH4IFqX8u9adFDZZTY9n8uQdugaYnPgIuVK2rdDNFxPNOtRrE7K1M1ofP2IgqwV12pRwexUHYOehKBv214= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727707695; c=relaxed/simple; bh=dS7033UK5o0SDp12ez9+MsK/OvK6hEmTLroWCeXZvno=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rwwLWUXmaGHow6answRolevvGKgz2cmzFYDArB/b3PDhyAXhiTg/mj9X/lidDLDOOETe5GREaaGVN57oUZHcqU6A6xGVc4wkDM1fCV84StHzji5vQJxFAmZ/I9a+7/FamUJ5MDa8Yd1WLYFfzK9KKc8MvcJKg3Yo6gZF/gRRf+E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=jWX/7Qvc; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-37cdbdbbb1cso1314180f8f.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=vger.kernel.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=jWX/7QvcJYtxl/uqE1ZFULxjKzK0zKk5tv/lU1MGKHKdaIltfKKg2yL0uVl7CAN9LT 7Mhny4MTLEfVv+Rqo8dBjrRFcw+0GGgLBPDHhHQyJaZS96anYZofc6jKzESBfyZSEgoZ 1M1PmGaJeQHMkeavU/lZA0iFHV7jOcslJo1fX6/+AWRw+YvDOHjRnoLfivnUKfvYJF96 9TWpTa71Yy/YyVPhrYHtqMoLpmp0Q5WggQMAf1OLlrpl5JXpi4pTrqiChjg18Uqh0hzY JvKQOmvSzIJBoNSBh/R0H2G7Rt+qnbLQEIizr/dQs3iYmCkAfaNE7cAPPvvIm17hlcco 6tbQ== 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=NjTEExlke+hO++hr9Jva3KyvLXu/SnmeYpyBYtM5fS5O18x7/s1wxVxY+lJDMRxCCF 1hDh09f9MWpfNP2Lbp5wVvfkWub5onjsHJdEs/KIFgk7haa42+O1wX/uttIEu+jCSNZN XxvNOXQDJXeu5Pwhyvvas3nePheGhLJd8iYivwWhHIIezaslB7e8SrC/D4dl4PdP93D4 aqTPzLDD/5NSf36MEFRZaBA5CepsLZMAVWMRuXahEoedldKgmeTiFlyo9WWek+227eb1 j7ZDmjwpGBpjer6uChMDUcJ4epksVsja8J5qqN4f+L0djvqtedbbWWn0k17MGRzZZqv4 Zbcw== X-Gm-Message-State: AOJu0YzkerucTB+FuaoHoUNIoFmrUm1mncRZIo2NXMH4mvuVmjxO7+q2 +uE+aRbHw1Ikiz7zfMNRq5xgBI5ClYOfbVZSanoUx10s5rfc4yud9K8sg33IHkhCyiFrXe11gW2 G 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 Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 1991057 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; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=TJ+LHRQT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45d1:ec00::1; helo=ny.mirrors.kernel.org; envelope-from=linux-gpio+bounces-10578-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [IPv6:2604:1380:45d1:ec00::1]) (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 4XHPC24FW6z1xtY for ; Tue, 1 Oct 2024 00:50:54 +1000 (AEST) 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C47A41C2347E for ; Mon, 30 Sep 2024 14:50:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E4D7199230; Mon, 30 Sep 2024 14:48:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="TJ+LHRQT" X-Original-To: linux-gpio@vger.kernel.org Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 038141991A1 for ; Mon, 30 Sep 2024 14:48:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727707697; cv=none; b=FcKA3R4ZjnQReBBUVdJXkGbMlGm1LXyCIL1ygZP8zRbkXh7i8EXL13ckZjcc9IoOd7DjgteE/c10u3KBdjuJW2RGV6W9JAU3Jm5/Rm+4IEFrWR2KiXInScqmcAus2VoU4nOq0s4XboBuSIYLFA9KINOfIHmJS3I3s3R4z6sRVKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727707697; c=relaxed/simple; bh=EY3F+m5wtnL1iuaa2UQuujSwU3tmQznVQ28Ti6ey858=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MoHAUP4dBQLOYSep7K1wlM4c0tEMk6oD8LVVB5g2xB9p0oxgkYDphPOi0VDEwbDuYAxnSzr6itIvC/qkcf+qq+KT0OvYrLqnttU+MN2zRnMpOWLtJXZV4Y7/Iev7DB4aw/EVwZ/rRGyPEiF1hAaAeWUUg3XVvwyhE0HWtHJg3rI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=TJ+LHRQT; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-37ccfba5df5so2917474f8f.0 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=vger.kernel.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=TJ+LHRQT19Db/FZNlZ1Y4CoU31ZjS2xDoqps69TSvyun/i1hTHGirAnJ4s7sKlw4h8 Ci7mkOsGpmRwwGvqspvuNj25cqjDLlken8vlVoFvJlAnA+/ElXE5iLKk2MRg1mw4+5KN rCcV0qw7gReIkoP9+34swToZHZgFA+dABMo0+9kSAFEG4h/Il7zrMX7u+Z/rACOW+8HV wRQdvNojK9G9x2P4QEx1AJdEqxElNTVJcGq6C2wy6sreq2krQb/za9J9H9+J9cATa1Ch mn9GxDQk83/85Em5DA1nvACr+DKTqwwQDJHySThhnP+6Hk6TcQZMwCkl7/+C/tByWUtd NMbw== 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=a0P3SMJJxsvJBIemCcAFOlJ8llZ3dh1g3cQKq9IMNTM7MzFlTJskZn3cdDoo89VsIV NxpA3XWf1rDBY5Z9zpjhIBnWKpfLr0xPo9RX8ZdkUH2OvW8FVXRTmnCk3Ncq7hyjoPi7 TXJMQ9KsxdPAWnlfAnj1p5FcLYrWEan2NtC06x2Jguy92MjVnEoHyhKiqul5cY3Y7A+C BVwrUO11UeJYQAG4x5v7L7o8iwCfK0Ce/vc97yTCMll0+gxu+C2D53c2njwB9gKWRWHb 8mwqk5g4Y6mJsXL6uPugNwywD/uLTXi9nxeaMQoJBsOGLPULbyNk54lIzM0FDHeXXFZa JCxw== X-Gm-Message-State: AOJu0YyadvMyJtiO8GOf/Rl7zq9K7CDwjkB+uUs3d3vTFEFW1RUVIscg 6/TeFXHFrPzXiG3B4U7n7ATcWkTtTiAusOz31NjXfqhjMcLT8S6kIy0t6tWP2hs6VUZdcjUEteS 5 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 1991058 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; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=MQnPF69R; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=linux-gpio+bounces-10579-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XHPCP2dJrz1xsc for ; Tue, 1 Oct 2024 00:51:13 +1000 (AEST) 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 3F0AC284ADE for ; Mon, 30 Sep 2024 14:51:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7DB4D199930; Mon, 30 Sep 2024 14:48:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="MQnPF69R" X-Original-To: linux-gpio@vger.kernel.org Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2753B192B85 for ; Mon, 30 Sep 2024 14:48:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727707698; cv=none; b=siB/m2OVQijLztsekPTg8mAMStsJPdurdh5OS2b4ku5pHgDuvcflK2LD9XkdyZnnKcuIo41/ou8GkPv8hvQRTLpcz8aGALo7/RyOLLs/a+5CuvYxhSeHglSObNUNpGnWi+OxD8P+0MPsoHJDOqduoLolt0M5pF98PNBVDBmcVeY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727707698; c=relaxed/simple; bh=XyeXw8eHm4U0xRIzD5hFcCRVmwEbNSDv589PG5lUl74=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pPCC72ZRaNhJifARd12REWeRAUawEcMgjjtoNqf0GdJ/SGhX2DzHu8hqYv8qluzB1WtmD9GiddOO+BsVpsYkF6bvgDwoh8rl0LtwJCNdoDOX6qElMmoJSxaG8HabU04CfhDLsD6wk2MoCQMDhNght/SKkksu76x26uC5u8Kk124= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=MQnPF69R; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-37ccd50faafso2851913f8f.3 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=vger.kernel.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=MQnPF69RLDKe2DhPGAmndJgnKxSniaiyRZkyaX2Nm4adIw9A8ciIB0yIDSTg6Fyh0J PLZTWpe+dUaVelgYYgvzZqREeKn41hv/jBSAzQdK1GodsLqvsWFdscuH1EeeNrTURjdG AagOwC7biLl7CuD5VGey7U9ZgMrKRDqSvfB4rfa1HEMunu+xllnKlEDV5Ief0Kc0Ybvi KIBeI0pV+Pc8qRUUI4LN46qkEeDjjnbj9qYSZkCuLE5zrLxnu4KBTaDXES3rM+ULtLJ6 IWUIEtZsDVeOXc4GKmxGAnua3fePAMhHeL54V4L5QHQKklgSWlKZVbl/sMINlChrPiJo 0dCQ== 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=MQ4lkd78soQyy09G1Fkclv5KBBfrUbulBhCDQqeTi2nFH6oMllaNkCFak7v3LVJamv uDM94v2tWjkDD9In0Kcvj4UE9Dm/92sZ/92xKw7zDrUq6ctHPxHaluQN8ezT5pcNG6K1 ozInQigemYlz9ennkBx4XkL3OZ9JolRVpwn8KdlMorrzeIePFO/Bv1dQsWryA+ZOJ5Pz NIZiHwtyYduTXqcqCixBAWzQzBjzVhDlz/Pg57QNEQ5Pae0LqD2ovWYIY6V6ovCUWa3J Nyo1JaNzgWiOYsB0dNN74gFR3zfCOQ2ZPwFP7fHngj7UkvrMswhXBPeRdUxwRmel0deH Xbkg== X-Gm-Message-State: AOJu0Ywuhsyp3HF6rIM67EQU38SyAgip91nJcjBx6o8xN4IzxGtSvwM9 yB+j4Rtb6BKbpobBwAN/52ZB1NxDxeUwskmqKMDIxcKYyOCWWsSVsyReeoH1SiM= 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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)