Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp971309imm; Wed, 8 Aug 2018 08:39:14 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzTGcjpdhujNSU16fayOYvuLCXaR/01hUPnrwUNhzi/bIvwOcpUSpHMWk9uUy/H/z9UYcUV X-Received: by 2002:a63:bf08:: with SMTP id v8-v6mr2999683pgf.3.1533742754571; Wed, 08 Aug 2018 08:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533742754; cv=none; d=google.com; s=arc-20160816; b=BtWM5APRc4soUOFJ/6wZMUHINiccjRoc707h/E8VdBGzJWJN+uLQNChyvHVwr1o8/Y oj1LT53InDDHUNQbFVJrY4xvUwHll26l8ghBVeGWaNxKpysGDaaqAaDJNoTrkG3+MGzc Wq1viaD2JE/MNBUWzGT2OWUwU1j97mPs48bKMAgw7oshqkNWwfBNRG061CUCS4udiKLR lcQ1cgw0N+WXj1JcZDHsYBsKZHZM1l79eBjOEFU7POywhnH4DVKnvM2CsJezFm/VsvY5 i9VjMtsPbVWFx9A3uVRGvwW0lUi2vOKqBnhjS9cc7qYc8oS/6HKJjF47WXNogRZ/32pK ndaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=C1ENfkoTLjW8E17DVw+md+9F6tiK3Z1VCNCm2wV2Sh0=; b=HbmRVX3O8xc5lpivmzV8un2Ec9jJrUB8gAmPqvhbByB2vfVJcDWFHYgimBI6ajNvxI kW2kv3Amh1tmb66qy1uPV6vg0EX2Z3deFrMxkLlWB8NSk8QHY8gkVqMejPM5zMh25kpL i/9Yy/SV7dccxchOmAF6medGghHadst1RK09Y5c1M1GJgRqVW2OiAjiF26ePgG6uPlAL kS5Eh73LCt8dL0qr8iGPeNi+jByKcvEDob/vv5MtBQnGQNJ18wjxLFHXlCNEAsywek02 JBEKHgINE+ldrhi3bv7kJsyNnL+RoJpvsU6ua3kT4Djwt0DyU6nBZB0EWW9NPKYx5lwL T7DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=jPZR1hu5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e68-v6si3573360plb.38.2018.08.08.08.39.00; Wed, 08 Aug 2018 08:39:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=jPZR1hu5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729884AbeHHR5n (ORCPT + 99 others); Wed, 8 Aug 2018 13:57:43 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36168 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727823AbeHHRxp (ORCPT ); Wed, 8 Aug 2018 13:53:45 -0400 Received: by mail-wr1-f68.google.com with SMTP id h9-v6so2420515wro.3 for ; Wed, 08 Aug 2018 08:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=C1ENfkoTLjW8E17DVw+md+9F6tiK3Z1VCNCm2wV2Sh0=; b=jPZR1hu5zBkXG9rS/CQnTD+BZj8gpnkEM9pKhPLQz0sLHXzfppDAMqcLQFOncyiayL rcgsB1mru/+1XB8kdyDRoOaZWdkJ9787WgUisZ3SwQu6vxr0DWYU+8s7bZfb3tPHnOfx MN7FvU1aDT9UWADNBnCICEQRJeIjS9RXJ/vH0wJGuXyu3aG+C325BwmowNd64S6gSX3c 2KBqPJN/aZ4+c8BfDyWBd9RflXfeVcQcUEpO1Xk34IIirtmqfodmt/Q8onTCMOw43QZY DSmzGCckG9dDMZ4Ao9YVf9JvLyk4SdAkJwe7Ey3AjTpN9PSjaLtO/jqq+QkIdAybK02N Vq/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=C1ENfkoTLjW8E17DVw+md+9F6tiK3Z1VCNCm2wV2Sh0=; b=TzHuPvmvlxsP4GN5BagZCM1UMKWcErwqCYDop2t5Sl9fgjjxbNHCkBf2z2xcSzazG8 9RerQNHwplrrS9qi3u/AyN8IufTCl48sO3YGYZncWVq2WaWImoYH6BQiDBEWnlaS5Cio 6re9ftCNQsWLDjqkmStyOfDvPviRkqwmdhxy5PYKfYKN9JK9UTI0r91QWL4ZUPqzULEr GORheYvAfboU/Y8F/XQG0jKfkzejhULeDXqPallSCujNRonwtwMmCmiahVXqOx/8YVPJ K4EgBlCCDRIBgWGx0pKMztDkjuQfPrDjqX1ri+0k/p/sN1UcVbb8Jhb/I675SEvIyI3c kNnQ== X-Gm-Message-State: AOUpUlFQSpsI1/xMK86zekZtVjmwoNO+/ZrC3WeVO0yjjU7SIxfDdxsO i/oA98fFEeCUWHP6cFvAUJ6B1w== X-Received: by 2002:adf:f091:: with SMTP id n17-v6mr2355042wro.49.1533742413825; Wed, 08 Aug 2018 08:33:33 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-MAR-1-609-89.w90-118.abo.wanadoo.fr. [90.118.185.89]) by smtp.gmail.com with ESMTPSA id s2-v6sm5240915wrw.52.2018.08.08.08.33.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 08:33:33 -0700 (PDT) From: Bartosz Golaszewski To: Jonathan Corbet , Sekhar Nori , Kevin Hilman , Russell King , Arnd Bergmann , Greg Kroah-Hartman , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Naren , Mauro Carvalho Chehab , Andrew Morton , Lukas Wunner , Dan Carpenter , Florian Fainelli , Ivan Khoronzhuk , Sven Van Asbroeck , Paolo Abeni , Alban Bedel , Rob Herring , David Lechner , Andrew Lunn Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 04/28] nvmem: provide nvmem_device_name() Date: Wed, 8 Aug 2018 17:31:26 +0200 Message-Id: <20180808153150.23444-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180808153150.23444-1-brgl@bgdev.pl> References: <20180808153150.23444-1-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Kernel users don't have any means of checking the names of nvmem devices. Add a routine that returns the name of the nvmem provider. This will be useful for nvmem notifier subscribers - otherwise they can't check what device is being added/removed. Signed-off-by: Bartosz Golaszewski --- drivers/nvmem/core.c | 6 ++++++ include/linux/nvmem-consumer.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 128c8e51bff2..b040370292a7 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1440,6 +1440,12 @@ int nvmem_device_write(struct nvmem_device *nvmem, } EXPORT_SYMBOL_GPL(nvmem_device_write); +const char *nvmem_device_name(struct nvmem_device *nvmem) +{ + return dev_name(&nvmem->dev); +} +EXPORT_SYMBOL_GPL(nvmem_device_name); + static int __init nvmem_init(void) { return bus_register(&nvmem_bus_type); diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index ae4d30347602..c4000a218f67 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -69,6 +69,8 @@ int nvmem_device_cell_write(struct nvmem_device *nvmem, int nvmem_register_notifier(struct notifier_block *nb); int nvmem_unregister_notifier(struct notifier_block *nb); + +const char *nvmem_device_name(struct nvmem_device *nvmem); #else static inline struct nvmem_cell *nvmem_cell_get(struct device *dev, @@ -167,6 +169,11 @@ static inline int int nvmem_unregister_notifier(struct notifier_block *nb) { return -ENOSYS; } + +static inline const char *nvmem_device_name(struct nvmem_device *nvmem) +{ + return ERR_PTR(-ENOSYS); +} #endif /* CONFIG_NVMEM */ #if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF) -- 2.18.0