From patchwork Fri Sep 21 13:40:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 147275 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp838017ljw; Fri, 21 Sep 2018 06:41:29 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbkpr4qYW+S4gn9CPljtntDyYr738ZKNrw3KrjJHGMz5YKLnbW6EknNEC3UWWEssy4RzhmZ X-Received: by 2002:a63:c14a:: with SMTP id p10-v6mr41673355pgi.305.1537537289663; Fri, 21 Sep 2018 06:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537537289; cv=none; d=google.com; s=arc-20160816; b=t8MrWUbnc3rmWaLFVJLvQY7+EPSrd3bZ4t90n5joxcGAojKAH3YaKThPoV4ufajylb BQZUXdpLQBZrudjowmf+z1DearIdydfuFJYaJxjNIZigoFiD1w4k3no/WLow5d68Zukm skGENKUWS/c4EJUR24BH9ANn2Nrb1xWzM6dN8SKdT4ukFCu91Fg3Zdpv7E1HWTbMky0p cM8DUp7yr8g+rxd+v/ZPD+chAtRKmBtDQ0VZRVU873StBOSdDLxF5jTJicVOSyEbvdKx Xo0FqA4dkyQp6w87NqmQP1VJkjJGz312ogvCwba4ieVSK0TIPRCxWuY5Dyt21bjycuMW 7M1Q== 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; bh=oNzBGYfihuawjyk/eCJAx/BEOcMsD5l1BxHm2sP+SPE=; b=tFW9YonHE2CIk7G9+Tb4pPtvxnn46a9O2pTmqpv1s2lpCUcWO4NkKGcuI3KGHjL5ug PmaNk6USL8dyPGJri3OkHdZ/1Nnvkr/dnNY93zspYTj6bZ31ZH/H8LvYRts3f7PIavuh g2XzAWKkPYvtYlwqzB9uQgOt8NPjy1W4d8lpTCOQPRd7Fl0WoETeTSUR97xIYWLzgN6H 53zVGKnY8rJqwSiLcNRt7otT1GEnN14Mn9GPkh7zkK/snh/AwrvcS3Ei1DAkfUM7lj/w 01D5yVg73mxedDIBQgNU7foB7HxkH7wgG/JjovhA9ksNigELZq3uT6Eq8I0iYE4yR6+D JiCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kG0RuytN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb14-v6si29608068plb.178.2018.09.21.06.41.29; Fri, 21 Sep 2018 06:41:29 -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=@linaro.org header.s=google header.b=kG0RuytN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390445AbeIUTaV (ORCPT + 32 others); Fri, 21 Sep 2018 15:30:21 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:52113 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727392AbeIUT3z (ORCPT ); Fri, 21 Sep 2018 15:29:55 -0400 Received: by mail-it1-f196.google.com with SMTP id e14-v6so1998580itf.1 for ; Fri, 21 Sep 2018 06:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oNzBGYfihuawjyk/eCJAx/BEOcMsD5l1BxHm2sP+SPE=; b=kG0RuytNiqPZF0EWBZu0w4pNEoDzXYRk2lp8weJQ3KsrINeTJCKiYbQFS93Zju+Wo8 TAr8/d5/vPhE7O6fPkXVN2wPaF3H3n/VfeNa213BMash6kIWX3TOqaRVWIh+YIs6Ypmu u4r1mwzAs33ttH/jpPuaWaTDNrHtlwzyMvp5k= 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=oNzBGYfihuawjyk/eCJAx/BEOcMsD5l1BxHm2sP+SPE=; b=K6K/rmhahyh8lx9Ju5flyO6Ahk10NCphJ4imK0TPkM/HwV/XTrEdeA1d20fvjHtPRv ca0r+/fslwvWdwBtS1cdsmTFu4jxCldBDNknz8cVYAljt7yR6GUN18fnIcjfDyXyCRUv 5oHktFOzMTEideP4/7j01O3bGCyRfovtQcl/CAm4W5CyUqZKCfjtqbrpa75fVaiOkUl1 dN+GIx1fki57NWGrZZGjBf9NUsQvP5K547oEKBP5XtT6rCk7k4BNGnS3e7jT5Xn0hgR3 Kbt4T4sooksd/S6pJbJEfwgq1AmysFadioHB5hEPsxGLHg2pVcdSWqrlBbwD7bMezX3T a5Kw== X-Gm-Message-State: APzg51Ca2i0eGDl2ro9JtWlfr3msNMi7u/+7Fhx8TEjSaYn6VQLeRaPI NaY4b7DQJknZhZEXukip47rLkg== X-Received: by 2002:a24:5c8d:: with SMTP id q135-v6mr1594167itb.93.1537537259723; Fri, 21 Sep 2018 06:40:59 -0700 (PDT) Received: from localhost.localdomain ([209.82.80.116]) by smtp.gmail.com with ESMTPSA id c12-v6sm9896298ioq.81.2018.09.21.06.40.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 06:40:59 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski , Srinivas Kandagatla Subject: [PATCH 22/26] nvmem: use EOPNOTSUPP instead of ENOSYS Date: Fri, 21 Sep 2018 06:40:22 -0700 Message-Id: <20180921134026.4596-23-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20180921134026.4596-1-srinivas.kandagatla@linaro.org> References: <20180921134026.4596-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Checkpatch emits warnings when using ENOSYS. Some of the frameworks started using EOPNOTSUPP as return values for API functions when given subsystem is disabled in Kconfig. Signed-off-by: Bartosz Golaszewski Signed-off-by: Srinivas Kandagatla --- include/linux/nvmem-consumer.h | 30 +++++++++++++++--------------- include/linux/nvmem-provider.h | 5 ++--- 2 files changed, 17 insertions(+), 18 deletions(-) -- 2.19.0 diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index e17617fa034f..312bfa5efd80 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -93,13 +93,13 @@ int nvmem_unregister_notifier(struct notifier_block *nb); static inline struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *id) { - return ERR_PTR(-ENOSYS); + return ERR_PTR(-EOPNOTSUPP); } static inline struct nvmem_cell *devm_nvmem_cell_get(struct device *dev, const char *id) { - return ERR_PTR(-ENOSYS); + return ERR_PTR(-EOPNOTSUPP); } static inline void devm_nvmem_cell_put(struct device *dev, @@ -113,31 +113,31 @@ static inline void nvmem_cell_put(struct nvmem_cell *cell) static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) { - return ERR_PTR(-ENOSYS); + return ERR_PTR(-EOPNOTSUPP); } static inline int nvmem_cell_write(struct nvmem_cell *cell, const char *buf, size_t len) { - return -ENOSYS; + return -EOPNOTSUPP; } static inline int nvmem_cell_read_u32(struct device *dev, const char *cell_id, u32 *val) { - return -ENOSYS; + return -EOPNOTSUPP; } static inline struct nvmem_device *nvmem_device_get(struct device *dev, const char *name) { - return ERR_PTR(-ENOSYS); + return ERR_PTR(-EOPNOTSUPP); } static inline struct nvmem_device *devm_nvmem_device_get(struct device *dev, const char *name) { - return ERR_PTR(-ENOSYS); + return ERR_PTR(-EOPNOTSUPP); } static inline void nvmem_device_put(struct nvmem_device *nvmem) @@ -153,28 +153,28 @@ static inline ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf) { - return -ENOSYS; + return -EOPNOTSUPP; } static inline int nvmem_device_cell_write(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf) { - return -ENOSYS; + return -EOPNOTSUPP; } static inline int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset, size_t bytes, void *buf) { - return -ENOSYS; + return -EOPNOTSUPP; } static inline int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset, size_t bytes, void *buf) { - return -ENOSYS; + return -EOPNOTSUPP; } static inline const char *nvmem_dev_name(struct nvmem_device *nvmem) @@ -189,12 +189,12 @@ nvmem_del_cell_lookups(struct nvmem_cell_lookup *entries, size_t nentries) {} static inline int nvmem_register_notifier(struct notifier_block *nb) { - return -ENOSYS; + return -EOPNOTSUPP; } static inline int nvmem_unregister_notifier(struct notifier_block *nb) { - return -ENOSYS; + return -EOPNOTSUPP; } #endif /* CONFIG_NVMEM */ @@ -208,13 +208,13 @@ struct nvmem_device *of_nvmem_device_get(struct device_node *np, static inline struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, const char *id) { - return ERR_PTR(-ENOSYS); + return ERR_PTR(-EOPNOTSUPP); } static inline struct nvmem_device *of_nvmem_device_get(struct device_node *np, const char *name) { - return ERR_PTR(-ENOSYS); + return ERR_PTR(-EOPNOTSUPP); } #endif /* CONFIG_NVMEM && CONFIG_OF */ diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 8ae012f6545a..1e3283c2af77 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -100,7 +100,7 @@ void nvmem_del_cell_table(struct nvmem_cell_table *table); static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c) { - return ERR_PTR(-ENOSYS); + return ERR_PTR(-EOPNOTSUPP); } static inline void nvmem_unregister(struct nvmem_device *nvmem) {} @@ -114,8 +114,7 @@ devm_nvmem_register(struct device *dev, const struct nvmem_config *c) static inline int devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem) { - return -ENOSYS; - + return -EOPNOTSUPP; } static inline void nvmem_add_cell_table(struct nvmem_cell_table *table) {}