From patchwork Mon Oct 7 10:34:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 833421 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 DD5B118C013 for ; Mon, 7 Oct 2024 10:34:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728297290; cv=none; b=mUb0X6B8PBrgNCrw8ZcoOjJfogBxTVkQUwPMBs6qMSjoRZ3yXVJP5q2j29ZKHa9p8Jssppfpkr2rHPv41XdSN0nXvIag8FObWVqxu4sr2oViKe5xusWxnGC1LzxlQrK2wfm8G2nRSz7qpHpDtN8y7rMNme+aL8fEC0+LRt+eqx8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728297290; c=relaxed/simple; bh=1qPlnzcMGjfYtKZcC+y8Ac/zKIwCECeIicdIk0nKk6U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=s+sCECiIukdVGzYFmJ4oLFX+gDZ2381FAnyq5V3UtRxnfyPTNeYztakwJaMThQPUHBVtrjO9OSWnXULP+vGcR32MZL3k2hgiKGrgod/dVEe1ghVqlTmYKdyBSLWXWXaaY63qU1XIPRhNwyHHbhsSPC0Xfvd6tRAyqAb2/MpCXUo= 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=XEGeSGfG; arc=none smtp.client-ip=209.85.128.46 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 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="XEGeSGfG" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-42cbb08a1a5so43311475e9.3 for ; Mon, 07 Oct 2024 03:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1728297284; x=1728902084; 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=LRttM15lACyttOFmnb/OMbzHtGbNczmJy3XXf3scjPQ=; b=XEGeSGfGFy45yePMJxURX8fuFQvwbC7iiQmwT1n0WVmkyb+9t4i3fy4bEF48njHXba 772s49sRzVJb64BFViZl7jBfVq79NNTI8GOpiaQuLkwlMDe/iR17mtZ1Ej2LFvIDGG2I kS6oT5AHfKCOyUiPdgGq0GqHIJxp840Pna3z2hn+pU2IfmOX7ntLlqfiZMgGFMAWe4BM 9RHDXA0vrDV0lMShKesijtjI8FX5I5KLM+eTJc7thZThectK1Kl5oS53R1FmuLaLFq32 w+hS+3E6jbcPqB7U0JAw8JoU6bzmSwKWbhfTni4v/GSBqyrzztQvwp/H7qovt4aVDVD/ kf8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728297284; x=1728902084; 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=LRttM15lACyttOFmnb/OMbzHtGbNczmJy3XXf3scjPQ=; b=uc5y/1/Ph9a5f0UUOR5tSWTkB+Qv5IgGzt/hP/BnFqiWSe7ynbHCv0JSPhxGRxetyv jlCxep/oDUKLjo3x6SFjyfz4YHK4xR9lWWHaGiQdiGbibpax0usc08lviwT3Aom2U16H DdvnCNTmL+elLkwPpASxyG69ZSrmfWbHaVRAqTz9oovb8KJSsbgewE8KZZowpxZaqko8 C0En+MTt4WQo0c4gqzUhFtliq7DmSmaoh5wfzbFthGfSdpbMZPLisbdnFUPzNj0bQ0jC x2Gh4hf8nDYiVlZz6u4V3WI47f3NnYdArB/dMmYj7hxxhSN6uOX2++du6elRucFrBkQ7 s6Uw== X-Forwarded-Encrypted: i=1; AJvYcCWjkwDwnYTBNdgLs+EGf5X6ZLFcGONl4gzsaHjJCZenBoctYigrLTt9GGP/uHCvQBYyM21ZpLoe5vPN@vger.kernel.org X-Gm-Message-State: AOJu0Ywkjv52yMnv5Xlouar9XCLs2lCZYwnnIPwE/gbpsUqIsUwXqLuL w1NrXgGkXIxBUTzAQgg1kL5jj5rkL8ktFsURhaizO0AM03kZDK2NpIkNR/HLGUo= X-Google-Smtp-Source: AGHT+IFbZ4vVupz3Z0AyGdqcEjlQyrpqCoFOFGurA7FovfZmkUQIYEZk+qKenthhIBMvVS2W2Ec/1Q== X-Received: by 2002:a5d:598f:0:b0:37c:cdcd:68ac with SMTP id ffacd0b85a97d-37d0e8f74e6mr8254107f8f.52.1728297284165; Mon, 07 Oct 2024 03:34:44 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:6100:637:cbe9:f3bc]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d16973c2asm5423555f8f.111.2024.10.07.03.34.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 03:34:43 -0700 (PDT) From: Bartosz Golaszewski To: Keerthy , Linus Walleij Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 1/2] gpio: davinci: allow building the module with COMPILE_TEST=y Date: Mon, 7 Oct 2024 12:34:39 +0200 Message-ID: <20241007103440.38416-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 Make it possible to build the module when COMPILE_TEST is enabled for better build coverage. Stop using of_match_ptr() to avoid build warnings. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij --- Changes in v2: - stop using of_match_ptr() drivers/gpio/Kconfig | 2 +- drivers/gpio/gpio-davinci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index d93cd4f722b4..54770c917638 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -243,7 +243,7 @@ config GPIO_CLPS711X config GPIO_DAVINCI tristate "TI Davinci/Keystone GPIO support" default y if ARCH_DAVINCI - depends on (ARM || ARM64) && (ARCH_DAVINCI || ARCH_KEYSTONE || ARCH_K3) + depends on ((ARM || ARM64) && (ARCH_DAVINCI || ARCH_KEYSTONE || ARCH_K3)) || COMPILE_TEST help Say yes here to enable GPIO support for TI Davinci/Keystone SoCs. diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 76b58c70b257..1da1d7c7ac2d 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c @@ -662,7 +662,7 @@ static struct platform_driver davinci_gpio_driver = { .driver = { .name = "davinci_gpio", .pm = pm_sleep_ptr(&davinci_gpio_dev_pm_ops), - .of_match_table = of_match_ptr(davinci_gpio_ids), + .of_match_table = davinci_gpio_ids, }, }; From patchwork Mon Oct 7 10:34:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 833711 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 2EB201C6F6D for ; Mon, 7 Oct 2024 10:34:47 +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=1728297288; cv=none; b=cTXpARprbteZFrcqAxG2LwoeKzu7sH8LNvyy7SBYI2T9wCMZaTSPL3Lj6ErXctt7egvr5rpN9RV59C23mPnNLwWYiI/NZ7oOwxABZldgBPRbJr676I42+clvGKYpDxjki4wcpcnMXSr55IL2oQHYr9/dNrWCuTdwITurJ1aHRYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728297288; c=relaxed/simple; bh=SlaDyFesZTgQKQBDcA7YzZjmZ0V26ueX++PITxWWe6M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=baOs40D1DfZcQTRKXJV9WCKRdrwa6EW8WqT8wpHhXhpeFjDni+IkUR4srtV05/noqT7/9icDgWpMyrqyNB25a02XyfIvjCawGXckkodSNnwhAFyT1EO8FS3fPmJQ3mDdq/j56lM4mstly7WPr6JAqq2clS751e7UKKuXtdL9IYg= 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=CuasdO7U; 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 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="CuasdO7U" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-37ccdc0d7f6so2747498f8f.0 for ; Mon, 07 Oct 2024 03:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1728297285; x=1728902085; 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=+V+P9/krCI5PRnaWkpVBM3gsH3UMygBswIg4oiT5dmQ=; b=CuasdO7UcA/kgbt5/6/rmx3vng5YYobiQvi8WnGPdtfsH2yGkwtqHhNOwqn+shiIti QQbj9NYl02DmJLRoFVnF8mddVSEJle6LOvIDaZSZymNQTADh9wd8PAr42BYCPWYAlXZw at4uNVNkPfH7vtwN3ynjBwTMexafi14JusGRkCzKMsn3UniFEQnNZfHqWQE6blCz5ofA qpL93FpT0fo5bbmLmKDxsc13fBmakrcu+uqbL5xf3AFTXWXHbPnxJ4GstmW2xaNQV8B7 xJGYbW9rya2UfAySUzdfSxK9WwBG1VVW90luwiNzB15UvHTbf9Hnqd6qJNWBKPkDSClB aXYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728297285; x=1728902085; 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=+V+P9/krCI5PRnaWkpVBM3gsH3UMygBswIg4oiT5dmQ=; b=TgW++6cLu/D8J3+DijY9tGJhgMA9XRIYMwBdkg+a2SO8r9YXYJh8ttPfCDzl+qwWrL 4gK2fWY0FTeK+kVAAmFr09dxtEsr6KmimCGVjmAtLVpFtcehA6pFlfPGLM99RHx3MQkF hrlAzWH1tnRAl8J8/R99qnDrqm7zuSyx7zXuyf2NSb8Y5LnTnXg9a4Jt1PK9DCIokaPD j30gK3FLXf9ZfrEORzX1aiLyKY8+ass8JtWKQrm4SE/wQ+A+4asZiu3qYmiSY9DKXoKm 4vxgH09ObS2slYx+GKRPSAKbDxipGPIkTJK1ACsYnLi/5AdHVZ1w2rF7pyt9B/nz8a07 77vQ== X-Forwarded-Encrypted: i=1; AJvYcCU0dHW1TglXqgtzjTERSVJ87lNgY8woE62Nl+8XD3SW+SBH7oRK/iVKERcyzquQfxVFCNeMWe8royhY@vger.kernel.org X-Gm-Message-State: AOJu0Ywxlpa1+FhMTbk4XG2YSaHMNur3ygYLp8M2qpz+UPKsXfoDRdMZ I3mcDL8x5rmpEY2UeTYlxg/P68ttumXlHhX1I2Ar8RBiGR39/NhGGFwM0AfSAXQ= X-Google-Smtp-Source: AGHT+IG/u/VAP2bgAPDTl8iKAoB4INOf9h+ecMtARiYm1MEkHNdb3d3Ak/A841OAWDa1qYCK09ojcw== X-Received: by 2002:a05:6000:ec7:b0:37c:cfeb:e612 with SMTP id ffacd0b85a97d-37d0e6caf25mr6882490f8f.1.1728297285391; Mon, 07 Oct 2024 03:34:45 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:6100:637:cbe9:f3bc]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d16973c2asm5423555f8f.111.2024.10.07.03.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 03:34:44 -0700 (PDT) From: Bartosz Golaszewski To: Keerthy , Linus Walleij Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 2/2] gpio: davinci: use generic device properties Date: Mon, 7 Oct 2024 12:34:40 +0200 Message-ID: <20241007103440.38416-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241007103440.38416-1-brgl@bgdev.pl> References: <20241007103440.38416-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 Reviewed-by: Linus Walleij --- drivers/gpio/gpio-davinci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 1da1d7c7ac2d..8c033e8cf3c9 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -159,14 +158,13 @@ static int davinci_gpio_probe(struct platform_device *pdev) unsigned int ngpio, nbank, nirq, gpio_unbanked; struct davinci_gpio_controller *chips; struct device *dev = &pdev->dev; - struct device_node *dn = dev_of_node(dev); /* * The gpio banks conceptually expose a segmented bitmap, * and "ngpio" is one more than the largest zero-based * bit index that's valid. */ - ret = of_property_read_u32(dn, "ti,ngpio", &ngpio); + ret = device_property_read_u32(dev, "ti,ngpio", &ngpio); if (ret) return dev_err_probe(dev, ret, "Failed to get the number of GPIOs\n"); if (ngpio == 0) @@ -177,8 +175,8 @@ static int davinci_gpio_probe(struct platform_device *pdev) * interrupts is equal to number of gpios else all are banked so * number of interrupts is equal to number of banks(each with 16 gpios) */ - ret = of_property_read_u32(dn, "ti,davinci-gpio-unbanked", - &gpio_unbanked); + ret = device_property_read_u32(dev, "ti,davinci-gpio-unbanked", + &gpio_unbanked); if (ret) return dev_err_probe(dev, ret, "Failed to get the unbanked GPIOs property\n");