From patchwork Tue Dec 19 12:01:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 13498191 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 86911C41535 for ; Tue, 19 Dec 2023 12:02:06 +0000 (UTC) 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:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6IuFuraPoyxt/6lTY9hfLzV3gqyOVAijzfO8Vbx/9ZA=; b=SQr1wOLUD1Inr7 sDh9yTeuX39yzAVeIDnijIdpoqVJjJD/yHaq5DY5lQnlwmb2rgw/pUD0OY4wAOhNDg7TyN69WvIMS JLMgQLW7ZWDwvn9pancHZujv8z1Ghr4cs/dT/qGi1FtjsbvZRlIG9iBKPJsy0NXRnBkqG93QUJ74e duQFv9CfWyB/TylItwr5O11qu8nNc49knIwxHlcGXeIpJ0V9eANhWbhoNL2mB2U/0sXiYuMHqE7y7 9YT467PmVyKC4KvzrALnjv1PJUtSHGt2zN16rNgn5mzqFWO7tIv1HFdkVCbjHeckpxaXWkNIVFNJ3 fdmB2PRZXSxphEw3Limw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFYn1-00Dx0U-1m; Tue, 19 Dec 2023 12:01:35 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFYms-00Dwvq-33; Tue, 19 Dec 2023 12:01:28 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40d190df5d0so26929225e9.3; Tue, 19 Dec 2023 04:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702987283; x=1703592083; 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=T7yEMgXZhKtlt+r30N1IJsOJuMAaTYKKq9iU4tTYh4A=; b=dC8lvo8B4HByghfHuHo2l3QHTFIt+4vQl6NQmG0/3Mk/8J0qtbvosTcckM4HZcjGck 6VdqJ7BT146Qq8fPMUhoRtyXggKCBV8E2/lbOiCYJAIqFbmexoZnqXBeiu9XHhDoPGJv 3IC2p4DdIBcIJ12ClNcUmm24tHcac7mkiYgt+JxIMIoH4CQwBdLqtDdhCARrPnIJkhje Id/TEuLpGsWeyRupc+KTYpKu6anCKS3BHbmE6GAb/RMe7DNDENC2xFlHgTeCiVLrbA2A P0NcT/4XyXgPj5WDeTa2dppw0hdXJAtKzyRgyBxxTKITHpDSSYgEa0AVaJm1/VZBGHal 8tqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702987283; x=1703592083; 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=T7yEMgXZhKtlt+r30N1IJsOJuMAaTYKKq9iU4tTYh4A=; b=Ymp0r0qTAMPNbd1IUgtUWYDWyX8tFz6aVCw/GgicdfSRJerDJlqr1P3ybaGlktFVTQ 7mqrrE8KV7JSMKton1oD/xiujl2TYA+Sj9RwMUoGJWSWarWF/hZJBnBzrMMv3+VxArQx Vl/sKoFnZMQLz8gFnbip4Vaws6+W5nfDX+T9/at8qj6GaLeFGqoAx7D3xrleaUxLqHJi wZpC7WGuvd1rFohxg0TW7VIm0i1ltDg4SBIRVvqUWy8G3OOpuKIQkmDpjnePuf5jFdkT vgpJpA5TZdtPyTTPMTQBM9jwDKgi0XG2aZ72DNeB/75MLW3bERx+x7SBLnMophSnGfQD enmQ== X-Gm-Message-State: AOJu0YxPyMSHk5d37IG+S6dEzZHlb1ZldPzEjV+w52tBnVgpWxLVTr+8 KCebeZSbPLD/82GDUkr9QeQ= X-Google-Smtp-Source: AGHT+IFacrsz/WxyyAmEwuqg1BB6bNHm96HPr0zlPC74PGs1gxTM16a3p4tpZQe9CQsLj/7ekjHxXA== X-Received: by 2002:a05:600c:d4:b0:40b:5e59:c55b with SMTP id u20-20020a05600c00d400b0040b5e59c55bmr9283867wmm.133.1702987283001; Tue, 19 Dec 2023 04:01:23 -0800 (PST) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id ux4-20020a170907cf8400b00a230f3799a4sm6767478ejc.225.2023.12.19.04.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 04:01:22 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Srinivas Kandagatla , Greg Kroah-Hartman Cc: Michael Walle , Miquel Raynal , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH v6.8 2/2] nvmem: drop nvmem_layout_get_match_data() Date: Tue, 19 Dec 2023 13:01:04 +0100 Message-Id: <20231219120104.3422-2-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20231219120104.3422-1-zajec5@gmail.com> References: <20231219120104.3422-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_040127_025493_4E872DDA X-CRM114-Status: GOOD ( 11.06 ) 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: Rafał Miłecki Thanks for layouts refactoring we now have "struct device" associated with layout. Also its OF pointer points directly to the "nvmem-layout" DT node. All it takes to get match data is a generic of_device_get_match_data(). Signed-off-by: Rafał Miłecki Reviewed-by: Michael Walle Reviewed-by: Miquel Raynal --- drivers/nvmem/core.c | 13 ------------- include/linux/nvmem-provider.h | 10 ---------- 2 files changed, 23 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 441d132ebb61..4ed54076346d 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -876,19 +876,6 @@ void nvmem_layout_unregister(struct nvmem_layout *layout) } EXPORT_SYMBOL_GPL(nvmem_layout_unregister); -const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem, - struct nvmem_layout *layout) -{ - struct device_node __maybe_unused *layout_np; - const struct of_device_id *match; - - layout_np = of_nvmem_layout_get_container(nvmem); - match = of_match_node(layout->dev.driver->of_match_table, layout_np); - - return match ? match->data : NULL; -} -EXPORT_SYMBOL_GPL(nvmem_layout_get_match_data); - /** * nvmem_register() - Register a nvmem device for given nvmem_config. * Also creates a binary entry in /sys/bus/nvmem/devices/dev-name/nvmem diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 81a67642ac55..f0ba0e03218f 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -205,9 +205,6 @@ void nvmem_layout_driver_unregister(struct nvmem_layout_driver *drv); module_driver(__nvmem_layout_driver, nvmem_layout_driver_register, \ nvmem_layout_driver_unregister) -const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem, - struct nvmem_layout *layout); - #else static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c) @@ -238,13 +235,6 @@ static inline int nvmem_layout_register(struct nvmem_layout *layout) static inline void nvmem_layout_unregister(struct nvmem_layout *layout) {} -static inline const void * -nvmem_layout_get_match_data(struct nvmem_device *nvmem, - struct nvmem_layout *layout) -{ - return NULL; -} - #endif /* CONFIG_NVMEM */ #if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF)