From patchwork Fri Aug 10 08:04:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562373 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F128157B for ; Fri, 10 Aug 2018 08:06:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DFA82B57C for ; Fri, 10 Aug 2018 08:06:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EC6C2B65D; Fri, 10 Aug 2018 08:06:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A93602B57C for ; Fri, 10 Aug 2018 08:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=24dyUBGh2fWnWDpT45Pq9RBQ41N9IhhBQgAOjGExHDU=; b=Qq7DqWdHt8oFxs9gW/jhFR9wH7 jbCgH3APsenOlSaUHbugiQqr/zBU4DVt3YAeNtHFqjZzR3miwZarPem5klCqDDmyiOLWI8OOt/xmS FldaQQiQalUXt4ot9mfs2cZr7bpbjv6LwAsEn29EEX1g5DehoQI+EToGdQBZ5/fC14MnHISbT2nzF ZF7eYwViOFhvzGqWDX33lHJeZKnidoMf+eHJYcjwV0FqfXrGhg3Ps9Dqy8f7a1WWMMmL/EQFrrijc /f+2ljg8qKuzhsa9J3591ytShVqyUWaMZIH6LU2Xo0EUSpOcQrMd126U4FuAVDPpQpP5P8x8SUX6I O2zx+IzA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2RE-00035K-Eg; Fri, 10 Aug 2018 08:06:24 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qb-000298-MF for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:05:49 +0000 Received: by mail-wm0-x243.google.com with SMTP id c14-v6so919233wmb.4 for ; Fri, 10 Aug 2018 01:05:35 -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=C6+lAOCD7xYYjqAwsyLpdNynP10DYfCMxlDsoPITD5U=; b=Fj32K78hjOSxM5NAqapijcKbRg/4larGEi8ftAd5tBajKY92mFowMxQQk18GW+qzWv zxrnIkq/69gbVfOxlq2MwcfBKvoO7EWf0UEi4osZ5146rntyi+b7HTFExQOF4+gd5S4e lxawCv1CpztTCSE2PZIiumjeKv0tagGNM+SGuvqHXu4OA+NmbngdtuX3/iBAwu5HHL2p r1F5VqEqMpsYoL7+NMYprdJg8b06eC7uR844xP1ZOSuzCMSbZaE+5EFoaIlz4lzqaKAp IJp6ksJXeDmy4LJPU/G4sGyKCre9FCbhAbo8EVuA7SnlPYJ6QLZWyzRm/LLLZ8DtnR6Q ywKg== 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=C6+lAOCD7xYYjqAwsyLpdNynP10DYfCMxlDsoPITD5U=; b=POg+xXhu+0O+FZUPl8xadeDSgMp9RJbLkjrdceTJvISfPdioP5nEfQna+BbfoSMvZ3 ONWN2UvMF8abUJlKc6EhMHD9GFzy2MZfBVpxlVsh6Wn+GVdtJFB7PlU+WHJmJZvzAmel ux38U7FAsVLCGoCxv1vBSo6Mq3/azPXw+C/ihcGM6gyWeDGdU2J11l1Pr6QeeqGWREV5 djaEQ8qESCCV00iododUVsTen/HWrxd8NVFFKDZ6Mxvg6/IDLOHMRMv56RMkohlTVupD SET2s9go4w0adw7Z3EvCRnjB4ll8Ii7+kdumqnpdvxyRoB7phgifRLLE9T4EniVHwZUx 4U6Q== X-Gm-Message-State: AOUpUlFWZZwqyoPl/VF2+0E1zphQ5SNL0+CLjvydA4OFNutqFXQps6rr 60QDKKKkWFDLEKzA5uoMol2HWg== X-Google-Smtp-Source: AA+uWPzy3clBvGJg0JNyQdBbCp/prcqqEHgnMmGGNtBt3AvzUga0oigMCh8jYiBVJd4uCWcmRC7+Ww== X-Received: by 2002:a1c:28c2:: with SMTP id o185-v6mr804377wmo.40.1533888333968; Fri, 10 Aug 2018 01:05: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 h7-v6sm9546405wrs.8.2018.08.10.01.05.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05: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 Subject: [PATCH v2 01/29] nvmem: add support for cell lookups Date: Fri, 10 Aug 2018 10:04:58 +0200 Message-Id: <20180810080526.27207-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_010545_783710_377E6E12 X-CRM114-Status: GOOD ( 24.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We can currently only register nvmem cells from device tree or by manually calling nvmem_add_cells(). The latter options however forces users to make sure that the nvmem provider with which the cells are associated is registered before the call. This patch proposes a new solution inspired by other frameworks that offer resource lookups (GPIO, PWM etc.). It adds functions that allow machine code to register nvmem lookup which are later lazily used to add corresponding nvmem cells and remove them if no longer needed. Signed-off-by: Bartosz Golaszewski Acked-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 77 +++++++++++++++++++++++++++++++++- include/linux/nvmem-consumer.h | 6 +++ include/linux/nvmem-provider.h | 10 +++++ 3 files changed, 92 insertions(+), 1 deletion(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 514d1dfc5630..329ea5b8f809 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -62,6 +62,9 @@ static DEFINE_IDA(nvmem_ida); static LIST_HEAD(nvmem_cells); static DEFINE_MUTEX(nvmem_cells_mutex); +static LIST_HEAD(nvmem_cell_lookups); +static DEFINE_MUTEX(nvmem_lookup_mutex); + #ifdef CONFIG_DEBUG_LOCK_ALLOC static struct lock_class_key eeprom_lock_key; #endif @@ -247,6 +250,41 @@ static const struct attribute_group *nvmem_ro_root_dev_groups[] = { NULL, }; +/** + * nvmem_add_lookup_table() - register a number of nvmem cell lookup entries + * + * @lookup: array of nvmem cell lookup entries + * @nentries: number of lookup entries in the array + */ +void nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries) +{ + int i; + + mutex_lock(&nvmem_lookup_mutex); + for (i = 0; i < nentries; i++) + list_add_tail(&lookup[i].list, &nvmem_cell_lookups); + mutex_unlock(&nvmem_lookup_mutex); +} +EXPORT_SYMBOL_GPL(nvmem_add_lookup_table); + +/** + * nvmem_del_lookup_table() - unregister a set of previously added nvmem cell + * lookup entries + * + * @lookup: array of nvmem cell lookup entries + * @nentries: number of lookup entries in the array + */ +void nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries) +{ + int i; + + mutex_lock(&nvmem_lookup_mutex); + for (i = 0; i < nentries; i++) + list_del(&lookup[i].list); + mutex_unlock(&nvmem_lookup_mutex); +} +EXPORT_SYMBOL_GPL(nvmem_del_lookup_table); + static void nvmem_release(struct device *dev) { struct nvmem_device *nvmem = to_nvmem_device(dev); @@ -916,6 +954,39 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, EXPORT_SYMBOL_GPL(of_nvmem_cell_get); #endif +static struct nvmem_cell *nvmem_cell_from_lookup(const char *cell_id) +{ + struct nvmem_cell *cell = ERR_PTR(-ENOENT); + struct nvmem_cell_lookup *lookup; + struct nvmem_device *nvmem; + int rc; + + mutex_lock(&nvmem_lookup_mutex); + + list_for_each_entry(lookup, &nvmem_cell_lookups, list) { + if (strcmp(cell_id, lookup->info.name) == 0) { + nvmem = nvmem_find(lookup->nvmem_name); + if (!nvmem) { + cell = ERR_PTR(-EPROBE_DEFER); + goto out; + } + + rc = nvmem_add_cells(nvmem, &lookup->info, 1); + if (rc) { + cell = ERR_PTR(rc); + goto out; + } + + cell = nvmem_cell_get_from_list(cell_id); + break; + } + } + +out: + mutex_unlock(&nvmem_lookup_mutex); + return cell; +} + /** * nvmem_cell_get() - Get nvmem cell of device form a given cell name * @@ -940,7 +1011,11 @@ struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *cell_id) if (!cell_id) return ERR_PTR(-EINVAL); - return nvmem_cell_get_from_list(cell_id); + cell = nvmem_cell_get_from_list(cell_id); + if (!IS_ERR(cell) || PTR_ERR(cell) == -EPROBE_DEFER) + return cell; + + return nvmem_cell_from_lookup(cell_id); } EXPORT_SYMBOL_GPL(nvmem_cell_get); diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index 4e85447f7860..f4b5d3186e94 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -29,6 +29,12 @@ struct nvmem_cell_info { unsigned int nbits; }; +struct nvmem_cell_lookup { + struct nvmem_cell_info info; + struct list_head list; + const char *nvmem_name; +}; + #if IS_ENABLED(CONFIG_NVMEM) /* Cell based interface */ diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 24def6ad09bb..6a17d722062b 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -17,6 +17,7 @@ struct nvmem_device; struct nvmem_cell_info; +struct nvmem_cell_lookup; typedef int (*nvmem_reg_read_t)(void *priv, unsigned int offset, void *val, size_t bytes); typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset, @@ -72,6 +73,9 @@ struct nvmem_config { struct nvmem_device *nvmem_register(const struct nvmem_config *cfg); int nvmem_unregister(struct nvmem_device *nvmem); +void nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries); +void nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries); + struct nvmem_device *devm_nvmem_register(struct device *dev, const struct nvmem_config *cfg); @@ -92,6 +96,12 @@ static inline int nvmem_unregister(struct nvmem_device *nvmem) return -ENOSYS; } +static inline void +nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries) {} + +static inline void +nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries) {} + static inline struct nvmem_device * devm_nvmem_register(struct device *dev, const struct nvmem_config *c) { From patchwork Fri Aug 10 08:04:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562425 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D2DA090E3 for ; Fri, 10 Aug 2018 08:11:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1B222B72B for ; Fri, 10 Aug 2018 08:11:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEBF42B7F4; Fri, 10 Aug 2018 08:11:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 552372B820 for ; Fri, 10 Aug 2018 08:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VLJ4iuMfi3bwjq1ox+IhPquwVE+OIz/5K7him4h4NCQ=; b=Lbp+agc0u23ZKgZvo+J3h0mmSg yN42Q3/mfH9ycgOXPDY7rrhzHCPsYUqUBATUlHagtn9LcNdKU/BLKyP8yEnvFUpoh8Q2V+Pxsw9qU kCDciEwA6whRtIYoe8YM3IuMFCY5yIo5ur7vw4Io9XzyU82iKRj9Hy65BDd+QwB+0puXfwGw1Y62a mCMzMwuz9ZEytpqhV59ZdOl/an+a3uD6Yj5IWqPetiusTEja+BvKMcJKcVjNtRu28thqyGjWR1H8p 3cZ7d0SoWjbwLfJrAskxbPS+R7FKpy20JlFF7b6TmoVNroy2Tz8niLndFsrIkc/+9l3tNapkQbABs 9ZsNQaNg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Vx-0000zb-Sj; Fri, 10 Aug 2018 08:11:17 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qe-0002Ar-FV for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:05:51 +0000 Received: by mail-wr1-x443.google.com with SMTP id b15-v6so7446120wrv.10 for ; Fri, 10 Aug 2018 01:05:37 -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=auDnQ2msgcUIg2cR1NJaWEIgp9qglPcIziHCsh4zH4c=; b=hyVrD2uPCuDfG/SIVDF3sBQ3x5jPiEIiYfLhv4zCCwnLblKSqKqaAzB+653FJmrvzf 0e7bBYw1HAepWkf2U4LVpYgUjfZrKoVVh4FsuGcBMtiS+/SWcQle/y6aNI/rL+0drHQg jcV8QsqKTyRZoOsyt22VpaW9vTwkAFYZTn1EnN/IUhBp0W1GI+T7fDyIzwF8CX0/JejB qn+I0si68PVnhgSRuSUiRLU6KdgC6+/mrYiJiPtsG7TV+4jK228jLAs+oFZgJk5AfIKU lxIvEZrz9jOSA4FcAwwpvSafLhEQSuDJiaUTmMC9+byu6RvzOqCz0+7HA0qUPdS3cEax mGZA== 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=auDnQ2msgcUIg2cR1NJaWEIgp9qglPcIziHCsh4zH4c=; b=He4vYb0/3/ANGBPa4qPsUKkP3d7uaJCvKNlHzS5qLoKKfZndw2/3tjr98iJHrHwX8O mGnzqhb9gBpeH9CfPZmtQkMFhZsRhdbDD/Fb2cbIk5zI+zVr87GDcVLWbNjtkTgUdcE1 eNwiOZe0dTwz7OBEIrJ1/bs/DikO0XzgJ/Bx9xuCYQyqo8sMsN4UGo9mEEt2kwTMia8b 5oeWdVukqd/H5bZeS5mW9hzdFMTZp/S1rt47g/f/fhlFqpcoQeNf+6cKoh3vBl16LFbw 3QWzFdA19igt/+gSE0gf3d0RrdO0DzQEMMPvMZG5tgGomlAaokOkttPj+BPYuAevD7yu leLw== X-Gm-Message-State: AOUpUlGb7N+wXRvY0BtMGlHtDXQSktlX/vtpwzVNQfaEfrJcKXzb3xeR jC0qx1SG2ZqNKCqVjiji20yB1A== X-Google-Smtp-Source: AA+uWPymFzn6I/ZI2lEGyhAt132NMNyj5wgE/WcirkCrpDDb/X28TuLJrG8472LzrmsGj41RTdm2uw== X-Received: by 2002:adf:c78e:: with SMTP id l14-v6mr3521076wrg.230.1533888335767; Fri, 10 Aug 2018 01:05:35 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:35 -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 Subject: [PATCH v2 02/29] Documentation: nvmem: document lookup entries Date: Fri, 10 Aug 2018 10:04:59 +0200 Message-Id: <20180810080526.27207-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_010548_545456_6F0A2FA4 X-CRM114-Status: GOOD ( 18.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski Describe the usage of nvmem cell lookup tables. Signed-off-by: Bartosz Golaszewski --- Documentation/nvmem/nvmem.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/nvmem/nvmem.txt index 8d8d8f58f96f..9d5e3ca2b4f3 100644 --- a/Documentation/nvmem/nvmem.txt +++ b/Documentation/nvmem/nvmem.txt @@ -58,6 +58,34 @@ static int qfprom_probe(struct platform_device *pdev) It is mandatory that the NVMEM provider has a regmap associated with its struct device. Failure to do would return error code from nvmem_register(). +Additionally it is possible to create nvmem cell lookup entries and register +them with the nvmem framework from machine code as shown in the example below: + +static struct nvmem_cell_lookup foobar_lookup = { + .info = { + .name = "mac-address", + .offset = 0xd000, + .bytes = ERH_ALEN, + }, + .nvmem_name = "foobar", +}; + +static void foobar_register(void) +{ + ... + nvmem_add_lookup_table(&foobar_lookup, 1); + ... +} + +A lookup entry table can be later removed if needed: + +static void foobar_fini(void) +{ + ... + nvmem_del_lookup_table(&foobar_lookup, 1); + ... +} + NVMEM Consumers +++++++++++++++ From patchwork Fri Aug 10 08:05:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC1FF1057 for ; Fri, 10 Aug 2018 08:11:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAA732B7E2 for ; Fri, 10 Aug 2018 08:11:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E6C92B810; Fri, 10 Aug 2018 08:11:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 43CAF2B7F4 for ; Fri, 10 Aug 2018 08:11:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=dkJEVGDYsK8oae3M387VJPSUJK2wl0ywJjNIrLFLcis=; b=OC2LQoXI+iagQT5JZ+7Lk6/EFx XAjW7c/vWwRMbKvTdj3R7Dugd60ntrvLPSnU4dc3y74/CwOaLZ5KzPI477s2GoEdzWdj9NquFCDBI iMssgNj67HdqywiUZZpQVncGLKUP7CkajhGuk1uQKVDYgW0KIyGebgbUesn/D91ZrIFOtoM8bDCDZ NLSznk0bNyRK4fhUZGY8R8V4DKr9aEpElz+pgG02CA2AIK/p3Mw27xqPC0+TyG8CX1J3o6PhaqXuZ Q418sdA4DtmTjioBrdU4Fu5/KFkoaG4g/+Fu74wGYVRuf0vMoOViScP4artTfjazPdi1kf3bonNhE njJO9SGA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2W0-00014p-T3; Fri, 10 Aug 2018 08:11:20 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qf-0002Cd-89 for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:05:52 +0000 Received: by mail-wr1-x442.google.com with SMTP id g1-v6so7485504wru.2 for ; Fri, 10 Aug 2018 01:05:39 -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=0/AcFQWG5GWA8z8qElGqK0mK/sub6hcCVMsKNMHf7yU=; b=mp2BJsyMH5Jzh+AlT2TxMl2PXpV1RPDC5IaZTfqZFbmqbesVVLoNcBellbSwNfPWDV nvHIjtpIbHbVfVrI7MspXAXuk0D88llSO10SHw2su4SU1w1qsQFWJ+YEeTVWZ4/FX10k WWmxfLLYQ3enNOx860j2+05PSR+sGxJR6aLnfzbbOm8K9b39sWO+I3fqcv5I9kvI0h52 p/P3kBlt6IhyF1a3Zqtmc+wB1Dywc+u/mVEYBfinsqyYSpmWf7nTa6WBc8iwOaqVH5/G 7NLrG0IJ2wW9UB8+xo1anMudCckAFesZaGr4TcgHVFPHnAHN3fxMiOddOpp8UqoVbDf3 TSAg== 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=0/AcFQWG5GWA8z8qElGqK0mK/sub6hcCVMsKNMHf7yU=; b=Zi7CxAaL8CMiUmH9kUNkDcFfxZ5QHLzH7uGWWuUl5I/n7xPLMqkMKZ80SuN8PQziMt 4UmfYIr+T+lUrSW9qaPlI7S6cIU57JyNrsXhnZcB+25AaF0Kek2neCJ5A5hqFYPviF6f xt1eAulr7aGjJJJwiUNS8pG10I9iuk5upXNd/T0i6Jm//k7QPf7b9o6j7WcmseGq0K1f q9c8GkKnq/fh52IdU7TQw5WF4PQKzMP9vVpz5mt9pnGm9k7iFwmhCSmdTdtvu9L+0Nsu Bkpxf2apZZyC9jht39gDPLEG7VrBRDBwaSMSAuK4Yc1OAmslhEjX7ulEkxucodAIqoqb KSDg== X-Gm-Message-State: AOUpUlE2/wTZFRV0wO0/Y9A4964e0oigJfpvnB6SrWvG1TeIl8CuyGoo ZcHQL+6xFep6MlNdWd25KO7ABQ== X-Google-Smtp-Source: AA+uWPyNG+MiQkHL7lktzUB76ahe9sNj6vF0qIRC9Dge0yNNOKIwv31hpHplckplwuZoZjBt7WDFVA== X-Received: by 2002:adf:ecc6:: with SMTP id s6-v6mr3665248wro.160.1533888337700; Fri, 10 Aug 2018 01:05:37 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:36 -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 Subject: [PATCH v2 03/29] nvmem: add a notifier chain Date: Fri, 10 Aug 2018 10:05:00 +0200 Message-Id: <20180810080526.27207-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_010549_297692_C70D0950 X-CRM114-Status: GOOD ( 19.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski Add a blocking notifier chain with two events (add and remove) so that users can get notified about the addition of nvmem devices they're waiting for. We'll use this instead of the at24 setup callback in the mityomapl138 board file. Signed-off-by: Bartosz Golaszewski --- drivers/nvmem/core.c | 20 ++++++++++++++++++++ include/linux/nvmem-consumer.h | 18 ++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 329ea5b8f809..128c8e51bff2 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -65,6 +65,8 @@ static DEFINE_MUTEX(nvmem_cells_mutex); static LIST_HEAD(nvmem_cell_lookups); static DEFINE_MUTEX(nvmem_lookup_mutex); +static BLOCKING_NOTIFIER_HEAD(nvmem_notifier); + #ifdef CONFIG_DEBUG_LOCK_ALLOC static struct lock_class_key eeprom_lock_key; #endif @@ -479,6 +481,18 @@ static int nvmem_setup_compat(struct nvmem_device *nvmem, return 0; } +int nvmem_register_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_register(&nvmem_notifier, nb); +} +EXPORT_SYMBOL_GPL(nvmem_register_notifier); + +int nvmem_unregister_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_unregister(&nvmem_notifier, nb); +} +EXPORT_SYMBOL_GPL(nvmem_unregister_notifier); + /** * nvmem_register() - Register a nvmem device for given nvmem_config. * Also creates an binary entry in /sys/bus/nvmem/devices/dev-name/nvmem @@ -559,6 +573,10 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) if (config->cells) nvmem_add_cells(nvmem, config->cells, config->ncells); + rval = blocking_notifier_call_chain(&nvmem_notifier, NVMEM_ADD, nvmem); + if (rval) + goto err_device_del; + return nvmem; err_device_del: @@ -586,6 +604,8 @@ int nvmem_unregister(struct nvmem_device *nvmem) } mutex_unlock(&nvmem_mutex); + blocking_notifier_call_chain(&nvmem_notifier, NVMEM_REMOVE, nvmem); + if (nvmem->flags & FLAG_COMPAT) device_remove_bin_file(nvmem->base_dev, &nvmem->eeprom); diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index f4b5d3186e94..ae4d30347602 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -14,6 +14,7 @@ #include #include +#include struct device; struct device_node; @@ -35,6 +36,11 @@ struct nvmem_cell_lookup { const char *nvmem_name; }; +enum { + NVMEM_ADD = 1, + NVMEM_REMOVE, +}; + #if IS_ENABLED(CONFIG_NVMEM) /* Cell based interface */ @@ -61,6 +67,8 @@ ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem, int nvmem_device_cell_write(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf); +int nvmem_register_notifier(struct notifier_block *nb); +int nvmem_unregister_notifier(struct notifier_block *nb); #else static inline struct nvmem_cell *nvmem_cell_get(struct device *dev, @@ -149,6 +157,16 @@ static inline int nvmem_device_write(struct nvmem_device *nvmem, { return -ENOSYS; } + +static inline int nvmem_register_notifier(struct notifier_block *nb) +{ + return -ENOSYS; +} + +static inline int int nvmem_unregister_notifier(struct notifier_block *nb) +{ + return -ENOSYS; +} #endif /* CONFIG_NVMEM */ #if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF) From patchwork Fri Aug 10 08:05:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562389 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C36331057 for ; Fri, 10 Aug 2018 08:07:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B34C327F10 for ; Fri, 10 Aug 2018 08:07:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A64C72B575; Fri, 10 Aug 2018 08:07:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2A3A027F10 for ; Fri, 10 Aug 2018 08:07:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=76PDh3LzfMqZHCKrxJmKwcm4Zk2aKH3BqjkckFOyAuA=; b=bQb24sg6ysIfIkfzN0VWzM03Dm aTmWIJw4kWkQQMVtODaaIPY5Athoir0vzCgMP3Jj27WUhbRIiJ76m3o0LjmXMFE5Vmajz5sp0MOr2 tR0NFjL7eOyG2pnbtEVZIPlR3A3Le0SBpg7TGtaNr+SXjsSLL7WBBYibU6gWOCUdbd2t5MpDOOtih XBCbAunTrlSO0PVmAwxGi5ChnGLaQAXVDUsqzJUnpeYbbb0ZLAVW6kOk2PARISWVWbAhexIhyk0kO NZhmedtr972r+dbe5YrxwFQrexkPIXXJ4quZHlAk7dprMJywWNwxpGNxw9sSbv/spwJQRoD1Dmb1C 4xEB76Tg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2S9-0004Kz-Vb; Fri, 10 Aug 2018 08:07:21 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qf-0002E3-CW for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:05:53 +0000 Received: by mail-wr1-x444.google.com with SMTP id g1-v6so7485571wru.2 for ; Fri, 10 Aug 2018 01:05:40 -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=04JNfrthZ6A0LWJO3UnX3P3Vfn7v6Y2LHI6sap4PGyA=; b=hqq3555X+Bd7yqGI0t1QoDEZs08LvoBmD/5MVNG93EeMHXjvwplzU76Hkm8zXr+Ygd /Z0uCU5a/NRcu38Oe0Br2ridMa/KeyRic0KP5+js2bURES6O/kqdLzr6+C9xwUG4sFNL r8NAzGAiPiAuqdHPZPMfZ9hYl2bVy9mpOwWHMBhPcOaV2dpMR0w8+JkFpnFArD3CG/mU aW2eqWWuOTeOY8HZT8NGeTiV9S12TzO44JBtDXx94txANI9ABWQGJzhb52vxtaYgzLjK ZpYxBp8HZ3VmHMSINHEBI/EgEptjSrh3XvyZKc9eNCKYm5H66xWoZYc6CJLyTJoXqrnL EvKg== 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=04JNfrthZ6A0LWJO3UnX3P3Vfn7v6Y2LHI6sap4PGyA=; b=RpzBx5g7pZrJ4FRneSwZ5S9uQEb0qAtfZN0I4QZs8CsYmjew5PxQZgyoWC8qlqMeg1 DmtL1g7hcgkXSAqDQhsH5YejGHAFa04XZGk36i3BrA9NNJ+lJdmOhlaL/WTo1K2/Pybk UwjZXFrYy8AIIkEtKzXyx2La/X8JLFkXNTdQMxbE0w+bvR9ngROrtzBoImKnoVequMT2 NIJnNegO8Y23YmDpBMVgB7IJtljAlrbmwZF2dLy7k9YDd/sd4De+3kPsvi2FPBDxqh96 5eg55pJewT1RIAAQZr+8NerslGL/geD8Ek+IlstqtUVgc9DiIXopVXNzK07zR2cPS1Vi 83yg== X-Gm-Message-State: AOUpUlFkwlm+/BbosNt/L0ujaa+qNk5h7usGxCVXeGdH9RSIrU5U+T+p UQ+rzciLM2WEgCEX26FqfQTfeg== X-Google-Smtp-Source: AA+uWPxF5jkAahrpIjYHdzrfx94kx5P6segDsXSK9s9KQJNzxfl4nV8lbGVNt5k9/K+MlFbn7NX+dA== X-Received: by 2002:adf:8466:: with SMTP id 93-v6mr3389641wrf.274.1533888339531; Fri, 10 Aug 2018 01:05:39 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:38 -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 Subject: [PATCH v2 04/29] nvmem: provide nvmem_dev_name() Date: Fri, 10 Aug 2018 10:05:01 +0200 Message-Id: <20180810080526.27207-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_010549_426583_C50ADA6B X-CRM114-Status: GOOD ( 17.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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..31df2e6d6f72 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_dev_name(struct nvmem_device *nvmem) +{ + return dev_name(&nvmem->dev); +} +EXPORT_SYMBOL_GPL(nvmem_dev_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..14bb86a7a78d 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_dev_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_dev_name(struct nvmem_device *nvmem) +{ + return NULL; +} #endif /* CONFIG_NVMEM */ #if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF) From patchwork Fri Aug 10 08:05:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D78B1157B for ; Fri, 10 Aug 2018 08:07:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C95B527F10 for ; Fri, 10 Aug 2018 08:07:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCC322B791; Fri, 10 Aug 2018 08:07:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 69CA92B782 for ; Fri, 10 Aug 2018 08:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VJ2R4oqqGxZMTbnInNAVLjfzdlAOvtf9MsSZoLQxwiY=; b=PTyWbe5OGBs1PJF+OYqyOWzYBK zgF6LNmJCbZrolo6aIVaTXGsfZhmfRBGFfgvcRYq09T96e7CS+w0Dxwb/aW7EWs9zqGa/1IqXj0jE NjrE5XnsTnflNcntdeq+OzWNHMSDr/UFpM9hJ6LgBhc7SXQvCZdUuNjds3TC3F1HQMoWee7rCpGbx kYEloMIhUfu/ULJBxG/CcexPBlcnN4EeYDHDu2wUCH9gcdKMZ3RrJSRv6CxDbNV8HJwHoNX6iMh3L SvHlJJpqOsFI5b2FzizM/CjT/ZqKzxKH+w5NNEMwiigUpkx3IaZ0ph7A6GEmahqi2QtxWO7as/gbz eLOpt7VQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Ro-0003tS-O9; Fri, 10 Aug 2018 08:07:00 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Ql-0002R4-Ly for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:05:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=paBZJybUvvxWZ7I1PKX8NyqdoyvAh8f59AsdTQsxQjE=; b=kQrJVNF+x596tnQpECbUE7zrQ Avi4UsgBS2LDQ1nnETVqA37MTc/yGm2syMA+TxpWc4ZkHhP3G1UdDaPr0Pesy70p0ex2KiCL9uQ5/ Kc/ZAySHcD81SNROfSOypSxcDl9UscZxFGPEShaa8++HEgc3LdbKDKMx9iWt+zNJxm3QOoBf4GhoE 54a5WB/pYZu0koH/44OGEUXYCpFVwIzTkVwHv86mpvyECno3x+oAfXiuuMD1CTdttiQnW6cL49uw0 r0GSdIiVpQChig1Nn2wl6c5qciqeR2AB8z5Fvi/uV8z0hZ8zxIAaEkAy5gbotrGfO5aXZHC0Jxqts lrq4Mp8XQ==; Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qi-0000M1-CZ for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:05:54 +0000 Received: by mail-wr1-x443.google.com with SMTP id h10-v6so7461347wre.6 for ; Fri, 10 Aug 2018 01:05:42 -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=paBZJybUvvxWZ7I1PKX8NyqdoyvAh8f59AsdTQsxQjE=; b=JyjIVuraEgVEhK5SRVFay0GN4fUY9203oBblBwmIW7ZZ4OdK8tsCQso3CQsJbNTdIC zFZYNw4dGp+6ZtDOm1bXtDQQ5Pdc2+4SP7IRR6tQjk5VFUiCh5sa/kDYUjOJEQO2x9Zl 2h+sE5hE380ywLdTfzvTgCVgFuvXxOJTh3bmwhSY8ivhBoWApOE1UBSYDMyP4nzTKnLy 8vuROWjc+lmUev6WXIB9/5yBbFOKxJIouB3qqfKp0DF+DGaKV/T7FHsNSwrqE3S4TiU+ SVquCkZ6Sm8ltaOC1KOAmRtabfb5mvYJ+PiJByY3+RmldnsUI82Q5PRrgGb8WdC1hcKC W3eA== 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=paBZJybUvvxWZ7I1PKX8NyqdoyvAh8f59AsdTQsxQjE=; b=JcVFY12xe6RJPQo3k2ew3e/7KWHcCbHWwrDrHdgzKwiG1tcFhCN7MC5WzkqBPBaYFB 3j8DzRgZCmeUP3whHv+PpJuGCPSmXNQqCCLYo1R+NQFyPg04JVZpHPnyLAbd+B5Yfub4 6Sg6Cpzvfdo2msCrbCb4+VrP2qsoyYP0Z5qEVjxgn2u35v4aDamBy+NMN5Kqgm9ZPXcT dUnJQTnEKGoDkq8XAdQWKEtKWPb5Thp7JExAlZYIZHVDBRI6lAFzbVq6nyodfy3E3EYG GySSIVXZCFc3xy3aUNLx4oE/seK6cfy9KB0Z7DIiOkmOOlUzz5C/y2i3e/4YV1qpLIIi b7Cw== X-Gm-Message-State: AOUpUlEkEFVQDOIMvuvF36Rz8Zcgn2DpWracI3Pj1j5+UF2xNK1Tf3h1 JUFB8F9B4NRL8ZIGDlTDLS1R2w== X-Google-Smtp-Source: AA+uWPxPcUpQhBROdDATdjNUBaS0soH9ECmya+4jv8PLxdtymCewzYsuTuTaB/510RDrzB3C8+q4sw== X-Received: by 2002:a5d:458b:: with SMTP id p11-v6mr3507964wrq.122.1533888341327; Fri, 10 Aug 2018 01:05:41 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:40 -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 Subject: [PATCH v2 05/29] nvmem: remove the name field from struct nvmem_device Date: Fri, 10 Aug 2018 10:05:02 +0200 Message-Id: <20180810080526.27207-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_090552_474550_B16E6056 X-CRM114-Status: GOOD ( 19.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski This field is never set and is only used in a single error message. Remove the field and use nvmem_dev_name() instead. Signed-off-by: Bartosz Golaszewski --- drivers/nvmem/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 31df2e6d6f72..ab3ced2d9a84 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -26,7 +26,6 @@ #include struct nvmem_device { - const char *name; struct module *owner; struct device dev; int stride; @@ -712,7 +711,7 @@ static struct nvmem_device *__nvmem_device_get(struct device_node *np, if (!try_module_get(nvmem->owner)) { dev_err(&nvmem->dev, "could not increase module refcount for cell %s\n", - nvmem->name); + nvmem_dev_name(nvmem)); mutex_lock(&nvmem_mutex); nvmem->users--; From patchwork Fri Aug 10 08:05:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562489 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8DBF0139A for ; Fri, 10 Aug 2018 08:57:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A9902B838 for ; Fri, 10 Aug 2018 08:57:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C89A2B879; Fri, 10 Aug 2018 08:57:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E12C2B838 for ; Fri, 10 Aug 2018 08:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=emehlQDfwHUu9joLQWAhwkqUy5QMG9OLJdGrsuqLIas=; b=UGsgOEy4cJIABWRkORfbB2ogxT wUMBjS5ZFAcvUeUrWE7u5YjYtBgBIe5keKYIZPkulFQt4f3lMmcqfLW99WRr8QGMSDh5wFHdJ3D/p MJ0il4wl4kTAhxsIm/xrrEpWzeQcVvBQD4dbZHpxmipAP4fupLEBr5eWCLa+VPBSFJkSRsNIy/bw2 F0XLIz8DndcYON3JgCPk570ffKO3I/A+00FAag+3cTSr+iHPcOKMkz2G3wffd2OHYQYeE7D0GE70H YFTXechURv5q7Zsc9xi2ZNQsolhdgSekQZOREl6YaL7HFow9wjU4666noytvLLyQHjDbeUGcFaSXB O+UbXmNQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3EC-0004xI-Vj; Fri, 10 Aug 2018 08:57:00 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3Ba-0007pj-5f for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:54:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=K/YhS535+x3roX9HgmgmHSzJ3fTxTwkZzhUtcXxc/ek=; b=PQp+zfWL4VFt4ONYvOi5p8RVj 43e1xWeTc456fGATdM+OQ0gbjv9qnC6GIrs2BrkbrendiA0Y76lqnFiJc7vajU4Z+wcfW3IZp0VQ9 uk9IWG0EmfMCP8UCWPI4HC5OB97TyQisPho0RmaODJTsWA1Ua3smOUpY/pPeUVJ5L5NmwzW61kt8W LFbyFeqo/ImGboN1DmLaVRbD4UeGG1i+QzJN8wYU2SnDkku6uzX01AmxReEsf1IkDnuZqm0bK48ar bDI759Bzem3q0w32FoIwbnq2+UnKuKU4fgi8erKclxMzjEzVAsyhUZBcF4hLBcGW4A08l33hk5fEl NI6Jk7l6w==; Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qp-0007VC-5P for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:00 +0000 Received: by mail-wm0-x243.google.com with SMTP id s9-v6so926898wmh.3 for ; Fri, 10 Aug 2018 01:05:44 -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=K/YhS535+x3roX9HgmgmHSzJ3fTxTwkZzhUtcXxc/ek=; b=0rE8hF2VRFrmynJ0XeHXlsLYkdyEBPWuOydh8hVQx1c39gXULu892TW61of1eC10vZ Ph9riIPat2gBlsn1VUWYqGvl62epG/4dPg4WRyvOO32GTfqVNoLdSyvUSNUpfy6Odcax 9sVmRdOcQg6I+csUbmaF9jVEUr2rN1adUP8aExfRZ46GtI9U3baAFwWN4JFZW8GYHuAi oMmJ5GoqE7J0QyPkelrsO7AOTZOV1XXuPm7jem3RH1DGxOFZ68RqKoYhd+9czuSSZVdR 8orqsCDB59w2sK9I0h9spv7NT0l3qXx6eUpS329fBTrlUFW1sw7sRIHja330Qb86CUYo kKJw== 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=K/YhS535+x3roX9HgmgmHSzJ3fTxTwkZzhUtcXxc/ek=; b=VTuezwcY7Hgg4Bb3zbkVZcOmoIDPD2seUHb86cm07u8xQeyftagcwe/2bSfC7lmV6N 1808aK4BuWDulleqKQvessd+qYJjfsLYEkQu4ORHVNKtFpsfTckO1LcW/9gWeZ7CGiXp cUU2d2q1zC2rslTUkO+t9VHEEUI2q1G9REb1m9j1+FD24njWIpG31UV0lqLxV07SoiWV CtS/eCm04m7twqcFZmuu+fosTyYmDoWTDZyVJOufigNWLJv8AeKzMEuV7/wvFWcvuFWj Iw47gv3leugUlWIvWdPMP2I+jnYE2fXuoGsxNjX31PgFeeeYhcQ8rzppvgOGul+fUmdi /rnA== X-Gm-Message-State: AOUpUlF/yakXO7hDx3gY41m856ySOOV/4sCghjQKLcbJqJ2AqXRw8qpP 0A8Rdtc1v31fLPz2V3o2FHl0lg== X-Google-Smtp-Source: AA+uWPwsxqQbk4KADBd35F8Q1fUTcCgtM0Qk6bisvhFHq8d2nLhuDSZa+S3/rb4nLhfgY2tMkeoIRg== X-Received: by 2002:a1c:8952:: with SMTP id l79-v6mr742323wmd.7.1533888343181; Fri, 10 Aug 2018 01:05:43 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:42 -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 Subject: [PATCH v2 06/29] mtd: Add support for reading MTD devices via the nvmem API Date: Fri, 10 Aug 2018 10:05:03 +0200 Message-Id: <20180810080526.27207-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_040559_217466_E164FD1F X-CRM114-Status: GOOD ( 25.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alban Bedel Allow drivers that use the nvmem API to read data stored on MTD devices. For this the mtd devices are registered as read-only NVMEM providers. Signed-off-by: Alban Bedel [Bartosz: - use the managed variant of nvmem_register(), - set the nvmem name] Signed-off-by: Bartosz Golaszewski --- drivers/mtd/Kconfig | 1 + drivers/mtd/mtdcore.c | 50 +++++++++++++++++++++++++++++++++++++++++ include/linux/mtd/mtd.h | 2 ++ 3 files changed, 53 insertions(+) diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index 46ab7feec6b6..f5549482d0df 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -1,5 +1,6 @@ menuconfig MTD tristate "Memory Technology Device (MTD) support" + imply NVMEM help Memory Technology Devices are flash, RAM and similar chips, often used for solid state file systems on embedded devices. This option diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 42395df06be9..a57302eaceb5 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -488,6 +488,49 @@ int mtd_pairing_groups(struct mtd_info *mtd) } EXPORT_SYMBOL_GPL(mtd_pairing_groups); +static int mtd_nvmem_reg_read(void *priv, unsigned int offset, + void *val, size_t bytes) +{ + struct mtd_info *mtd = priv; + size_t retlen; + int err; + + err = mtd_read(mtd, offset, bytes, &retlen, val); + if (err && err != -EUCLEAN) + return err; + + return retlen == bytes ? 0 : -EIO; +} + +static int mtd_nvmem_add(struct mtd_info *mtd) +{ + struct nvmem_config config = { }; + + config.dev = &mtd->dev; + config.owner = THIS_MODULE; + config.name = mtd->name; + config.reg_read = mtd_nvmem_reg_read; + config.size = mtd->size; + config.word_size = 1; + config.stride = 1; + config.read_only = true; + config.root_only = true; + config.priv = mtd; + + mtd->nvmem = devm_nvmem_register(&mtd->dev, &config); + if (IS_ERR(mtd->nvmem)) { + /* Just ignore if there is no NVMEM support in the kernel */ + if (PTR_ERR(mtd->nvmem) == -ENOSYS) { + mtd->nvmem = NULL; + } else { + dev_err(&mtd->dev, "Failed to register NVMEM device\n"); + return PTR_ERR(mtd->nvmem); + } + } + + return 0; +} + static struct dentry *dfs_dir_mtd; /** @@ -570,6 +613,11 @@ int add_mtd_device(struct mtd_info *mtd) if (error) goto fail_added; + /* Add the nvmem provider */ + error = mtd_nvmem_add(mtd); + if (error) + goto fail_nvmem_add; + if (!IS_ERR_OR_NULL(dfs_dir_mtd)) { mtd->dbg.dfs_dir = debugfs_create_dir(dev_name(&mtd->dev), dfs_dir_mtd); if (IS_ERR_OR_NULL(mtd->dbg.dfs_dir)) { @@ -595,6 +643,8 @@ int add_mtd_device(struct mtd_info *mtd) __module_get(THIS_MODULE); return 0; +fail_nvmem_add: + device_unregister(&mtd->dev); fail_added: of_node_put(mtd_get_of_node(mtd)); idr_remove(&mtd_idr, i); diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index a86c4fa93115..8121c6582285 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -339,6 +340,7 @@ struct mtd_info { struct device dev; int usecount; struct mtd_debug_info dbg; + struct nvmem_device *nvmem; }; int mtd_ooblayout_ecc(struct mtd_info *mtd, int section, From patchwork Fri Aug 10 08:05:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562501 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B3AD157B for ; Fri, 10 Aug 2018 09:11:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C1942B8A7 for ; Fri, 10 Aug 2018 09:11:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19C3A2B8B9; Fri, 10 Aug 2018 09:11:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AA5B72B8CA for ; Fri, 10 Aug 2018 09:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Ap+JaBYzh8dz19I171zDzCip2p5cB8Gu+vMRszMJfWg=; b=RkucdMA6jIipN/zA5oiJKgVus7 1x+QhURwq24vd5UWbxRy+S/BE2Rt0cmuofAXumh/h4XjaaKf1YYogc6P36bQNGypjAv+Yj2CxgihM aG+rhZJbwxr/oZ+/M81MFeji0wMR/ppOY/MKbiJqJsJzhMH7Q3ruQfEX4ybV6S3/WGMi0iy1R2z5E iNasckDafR6FSdc+ygN7i0aqj6AF3PaU1diwv1bo2MRRPvsx5s+8gIFQUas83p+qXyxO0vo/+tMsg 6mCiedCLiiP80SP1lO9RDdLG+kT4lQkdln/TDwseeLgnRR/aY1tB6JJmuauo6hMWnmzQrh2SAIh/p cRyIjx6w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3SE-0003iB-Lb; Fri, 10 Aug 2018 09:11:30 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3BY-0007pj-Kx for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:54:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FwyNGSHiOJtGONRaDr8ThVu1ERv+Zjqtryg9AOfSNOg=; b=MmTWU+xUutYWN/dMIQYdFMzcc d6mlpZWNGmjMJLYkM+1SJGd/rHfaGQO5IBmdEt0+7+6GXEIOoFtIDak2eFQPPKrM/rZQ69XGzRuDV IIM3wWq1Ns1JDyJT6d4xg8MO79x+qBEq4LnpRD2A4QEhNi3hfrxztnlDya2H8LmS8OGur+Dy6cfBR KjegbWAfZysSYDQJheRIFXwA0TOWJBWf2mIu6v9eNlkkLD4EgSPKryC3boRvxZffVO4D1AiUy5+Ux McUjcPZlIV+V4pdmhA+AEWQt6SzEPULE3QYdH0SWzNl+OzEphSMieZH6Goh2KFOMuY0IKxqZRzQGC FFSP+EAyg==; Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qp-0007VN-F1 for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:00 +0000 Received: by mail-wr1-x441.google.com with SMTP id g1-v6so7485812wru.2 for ; Fri, 10 Aug 2018 01:05:47 -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=FwyNGSHiOJtGONRaDr8ThVu1ERv+Zjqtryg9AOfSNOg=; b=hpbHyybqOz4E2uVHyVT+2GgLMXrKdt6w6C6XcRDtPYAW54YvGdyDToBmubnIZk9suH tOtjJw2FS2UqReoSnuvU4XivlJJUN8WiMeC1xwnpNq3rtBWrtWFtQ5VB8MYaLkCKoQ1Y eHgQ050yRpH7mCSqzyvgWT5NuflUn53IZqT1prc0qDrrWjkhQUzMFX36a7SHyaebOT/n TB4vJDBG+DPwD+V8QZzRCqLRHwuLEptjkuOC1MLRUTTzwE4k45rGO33kiJ5YgFsxL7wI LO6eHX6+Rf3F5UvAxT1TfsShXgNG71xGwSvRZ3gOVdhREWBCiAWtllK8F4zVEPtH4heU ImcQ== 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=FwyNGSHiOJtGONRaDr8ThVu1ERv+Zjqtryg9AOfSNOg=; b=BVUFugyNDuWSZbVl1rlKu/ifuEcpwPzXCbF+5mQKwJWLk06angkPy2kszwhHK6FSzY YHreGEd5wk/2AeOcsUscx7fIYr/uxfTsxnTnKvEtOzVFjCrl5cg60P9iAcm2WvPfZo7l 3W+92zgs42eRBUEnEv57mLI8/6Ug3kgVZk97pOseb3TZKptvDA6fpnyB2VVZh3cF+eEF T06YoWjbImKxBH7lHBnxH/mkRJv3X0iAv21AtFbIhkNfOKL5lwo9SZ/+JXg7b8lEoOiP gpmoB7WXA6dqpmeBFXIUg7OVEnHOliwP1WuQAHIQwpd0gts7RV3o5aK8iZQbtihMKUwo 6nHg== X-Gm-Message-State: AOUpUlGE0KLF4WhSb0EVIM0vbu6YobBvd9D3f8VjvgPeN27LTCrYdvpj inS0Q9ldvR9/o5QbS2XASM/aww== X-Google-Smtp-Source: AA+uWPwbRZ4qbxJYpAg+IYZPFTqoclehtJo2xzwKjACWoVjj9ER+07jUmdmdQUzbJBGsORJ7A2umQQ== X-Received: by 2002:a5d:5349:: with SMTP id t9-v6mr3377951wrv.186.1533888345376; Fri, 10 Aug 2018 01:05:45 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:44 -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 Subject: [PATCH v2 07/29] ARM: davinci: dm365-evm: use nvmem lookup for mac address Date: Fri, 10 Aug 2018 10:05:04 +0200 Message-Id: <20180810080526.27207-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_040559_517365_D4C4A87F X-CRM114-Status: GOOD ( 18.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We now support nvmem lookups for machine code. Add a lookup for mac-address. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-dm365-evm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 435f7ec7d9af..cf3f2e611228 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -169,6 +170,15 @@ static struct platform_device davinci_nand_device = { }, }; +static struct nvmem_cell_lookup dm365evm_mac_address_cell = { + .info = { + .name = "mac-address", + .offset = 0x7f00, + .bytes = ETH_ALEN, + }, + .nvmem_name = "1-00500", +}; + static struct at24_platform_data eeprom_info = { .byte_len = (256*1024) / 8, .page_size = 64, @@ -769,6 +779,8 @@ static __init void dm365_evm_init(void) dm365_init_spi0(BIT(0), dm365_evm_spi_info, ARRAY_SIZE(dm365_evm_spi_info)); + + nvmem_add_lookup_table(&dm365evm_mac_address_cell, 1); } MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM") From patchwork Fri Aug 10 08:05:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5800A1057 for ; Fri, 10 Aug 2018 08:07:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4805D27F10 for ; Fri, 10 Aug 2018 08:07:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BAC52B575; Fri, 10 Aug 2018 08:07:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C5DCC27F10 for ; Fri, 10 Aug 2018 08:07:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=G3eNGyzEAI7w0l7IofSRoZ7w8ufRZDUCrASfLgCmQp0=; b=HdSKhR1abBUoOFMIh/7lBQatuk 0LnQ6jbRVKjalClx29T5woWThip75p5SyeefKE6XnTN4jqFimVktxuF4YFMJmStuySxJz1nnX1FgM T7s0tUNwkSu2vPH7PZCoZ2ydbI3qQ4oxWZkWXzZb2qnCBV0bX1BPGY943cJM1Q5Mnw4n2tJdAG0xP bCzyv9TB3WGsRZKFMHCKY8NkRwqwO0rK4wTKXnXajs4dvx/SPkigHu6XsTI1hSZK29J17hU2SqCQP ca7SOmgl+n91iXY7qKrx2dgOtHitDApn54EQBiqxvqFrA85/gNlCHn+71HBhx5MCkRsMIcFBoXD42 A7VR9BPw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2SK-0004Y2-7m; Fri, 10 Aug 2018 08:07:32 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qf-0002K3-RQ for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:05:55 +0000 Received: by mail-wr1-x444.google.com with SMTP id c13-v6so7495814wrt.1 for ; Fri, 10 Aug 2018 01:05:49 -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=XaPQ4DQ6E4mkvE8/vjM2arlDkF10+DPHDgPAjo5lV1o=; b=d8jmMSS0r7+bNNo9YTWkd0N3UUg9gNZCUwkFuspa7Gad0bgKdmW/SeArVPVrICkkua FQqpNjEcVPxQySfOunIGiXl6cz7TL6ZiMji570BUqzEEsKx5rA4G0H6bN4HQgEDubpfj 3zWoapKg2/vI+/i/ahfY/KQmexgSBloSnXPmIHK5zcelobeGazNfZqbb+frzVRqE5pbS 8vB8HQt41QuBYNax/SCdrX0x2nl6TKXU80Z+3iyHk18vtYyVDbuI2bOlNAvNBQypGXbt Om6P0IJxqvIHvT2a+7TsLHhZxOkdHD3smm7hy7Ft9aJtqmHUvQj7C43je8QxC9mH4p+r 9qlg== 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=XaPQ4DQ6E4mkvE8/vjM2arlDkF10+DPHDgPAjo5lV1o=; b=drQp7/uytmXmA74lETc3aD6ayioyyF6iRAZdvRdL8a3+WxVJh6WDlRjvrUJNUUgrRz toLSCqjITwZC1UQOepbyT84ECTu9WB5paVyTd5c0mBRc6Jy1KnBDdU+NjmfxSNxCYFV3 kKzbYRmDICze3Gv3Yuq9ydyAjkWlfwMvVP0W0WBcz2Ly/ejf3dlVKhrDdAinktLuM4Gr dRsLZGxuR5olw/TrqjLoaiUqiFeL5r0EOitabSL8hZjFtewojESBMTZ5hM8k/ADr4NHn 2NNGbZZ/AVAqfohfuE69SD8kqV46hA/uAKT/KKRRM/NfyUvlQY9cSYzYthqEDFdGvEPY 7B6w== X-Gm-Message-State: AOUpUlEL5OeVRppAu8GdijGw/HaqaSAK00R9TJvd4qomUzNT0iUZgW+d 3Wa92HOTR02zpX6IPPj80yTa2w== X-Google-Smtp-Source: AA+uWPwQ3qUFHPIEb7YNFm4XR8ZZUcQKNFNhNJMaN7NNGTv93XBpAeecOSbYW+Y3pEJI32GxaQ0evg== X-Received: by 2002:adf:ecc6:: with SMTP id s6-v6mr3665670wro.160.1533888348097; Fri, 10 Aug 2018 01:05:48 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:47 -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 Subject: [PATCH v2 08/29] ARM: davinci: dm644-evm: use nvmem lookup for mac address Date: Fri, 10 Aug 2018 10:05:05 +0200 Message-Id: <20180810080526.27207-9-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_010550_071184_D6B63ED0 X-CRM114-Status: GOOD ( 18.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We now support nvmem lookups for machine code. Add a lookup for mac-address. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-dm644x-evm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 48436f74fd71..829fa1c8d0b4 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -476,6 +477,15 @@ static struct pcf857x_platform_data pcf_data_u35 = { * - ... newer boards may have more */ +static struct nvmem_cell_lookup dm6446evm_mac_address_cell = { + .info = { + .name = "mac-address", + .offset = 0x7f00, + .bytes = ETH_ALEN, + }, + .nvmem_name = "1-00500", +}; + static struct at24_platform_data eeprom_info = { .byte_len = (256*1024) / 8, .page_size = 64, @@ -828,6 +838,8 @@ static __init void davinci_evm_init(void) phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK, davinci_phy_fixup); } + + nvmem_add_lookup_table(&dm6446evm_mac_address_cell, 1); } MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM") From patchwork Fri Aug 10 08:05:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562429 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69F5A157B for ; Fri, 10 Aug 2018 08:11:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 589D42B71B for ; Fri, 10 Aug 2018 08:11:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B6F02B72B; Fri, 10 Aug 2018 08:11:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D69862B71B for ; Fri, 10 Aug 2018 08:11:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=fqAMdTShcGDiujncfS0YwARRS0Gq53LWX4BeS0rqjG8=; b=QQzE3ykiMXE4dWxCD5y6wzud43 GaTN/m8bncIqb6QpS8EEdf50WWuQ5oaaETZcYiekl6upEqdpkeUTCMVo7nrW/d7G9jzjGhwC6rBCB TFFe/Ez5dYFED1787SqrhkiRrUrbtzzLX2hC3jXM3pl+klkVx8MpD1tVW2jDkaEXM/Y2CowOOyHPj sHGPaRPen0a6Tvl9AsKbSsFYTIVMH+fxpbjmwme5//A3oytLuWMPdaO0QoUSP/UniGXwBSC9fR525 MlCOdao9NltPTaR2eN1FEFlfJ6WyNtVBegS9qT5goonmq10ORls/4V6+ucRFU22kS+BKOMPreigK1 dQqc5kaw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2WO-0001bp-6e; Fri, 10 Aug 2018 08:11:44 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qr-0002MD-8r for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:14 +0000 Received: by mail-wr1-x443.google.com with SMTP id e7-v6so7441741wrs.9 for ; Fri, 10 Aug 2018 01:05:51 -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=G5kqWCsWMSj90Glln9/pjzOQBVCAn+wjThQrCeWbXjY=; b=cewKufJyOi4MN2nTblfsSAfiPvACoBYNyZNPM0atkEBznxXQ7sKq2JxrQ+2+0p7uCD UcvlDLlFkVk4vaLezAj2y+8ZjTfTmxr9m/5dBXgfQEHjkayryaj4az+2pqklz9VoDXID j9bf/d2uzJuEVQhXUGctMjnx7wwzizCAJNhdaa4AY1bVqOA4FxF6cl+yt/kYhX5mOugf 14PEh6zu9CkV124cseOCkFXoJsmmB8EXie833W/f3fal/VOZqCPkk8PD1naIfQfxq9/B JYZp+mzenjkYBHHlzGJeBUeY7CnZS8wpywIsrpu0FZJ8HoPIUYQcpSEMpNKk5zNdCkgA CufA== 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=G5kqWCsWMSj90Glln9/pjzOQBVCAn+wjThQrCeWbXjY=; b=fO1YOUuM1VnYXGOlwDRseVAm5XFSOhurzOv99BNIYZzcymgy741vseofx+OhciawFk tx9msU0xfMhx+fQTioZWoeNFp5ZPtZpv65rRrRB3VHf8AY6KxAYVSIvWPhfwbil0hAwr mK93mobTv/y3V5MRt0tKwHBDuN33HlAzHVHxCCOWADy7Vx/INzNHJKh8YcF4+a6K9Z0I Z+66bRHK+hxg022iH3GUkaxf9XWil+INwZ5fL9I+CBN1FiKenS55JakPuZgx8uzXqsXO 5U5EGeFMwmAdT+7vHzg/p9pbMQ5WJly6haMFRTotwua+VsxX/llf/HKHBNLYQaclWu2C ovhQ== X-Gm-Message-State: AOUpUlEqcAMlTtUmcDY4R/FYAGmMMDJOlClMUvZDxiUi9xL+9wUJ5Umb fq/+4nD0p7tSOOvGM0wQz/bxEg== X-Google-Smtp-Source: AA+uWPw/Gnx/xGfligkHKZKWSjU14CMK5H9IcmHK5JkFMKmXaVTFEdlAXhlemGX+z1tERW+yOh6u5w== X-Received: by 2002:adf:8466:: with SMTP id 93-v6mr3390066wrf.274.1533888349942; Fri, 10 Aug 2018 01:05:49 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:49 -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 Subject: [PATCH v2 09/29] ARM: davinci: dm646x-evm: use nvmem lookup for mac address Date: Fri, 10 Aug 2018 10:05:06 +0200 Message-Id: <20180810080526.27207-10-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_010601_659874_58C03579 X-CRM114-Status: GOOD ( 18.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We now support nvmem lookups for machine code. Add a lookup for mac-address. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-dm646x-evm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 584064fdabf5..943ab0ca6db8 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -310,6 +311,15 @@ static struct pcf857x_platform_data pcf_data = { * - ... newer boards may have more */ +static struct nvmem_cell_lookup dm646x_evm_mac_address_cell = { + .info = { + .name = "mac-address", + .offset = 0x7f00, + .bytes = ETH_ALEN, + }, + .nvmem_name = "1-00500", +}; + static struct at24_platform_data eeprom_info = { .byte_len = (256*1024) / 8, .page_size = 64, @@ -802,6 +812,8 @@ static __init void evm_init(void) davinci_init_ide(); soc_info->emac_pdata->phy_id = DM646X_EVM_PHY_ID; + + nvmem_add_lookup_table(&dm646x_evm_mac_address_cell, 1); } MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM") From patchwork Fri Aug 10 08:05:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562447 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D2FB1390 for ; Fri, 10 Aug 2018 08:24:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B0AE2881D for ; Fri, 10 Aug 2018 08:24:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D7482B3DE; Fri, 10 Aug 2018 08:24:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8168D2881D for ; Fri, 10 Aug 2018 08:24:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=6ShdfvW4/ZOWZUdH7K+QHzSt/W+4WXo4W4QMAdmcY+w=; b=EL444p5TCPT75ZSuUGV9KETYAe yH3RKPtKvbBk2SAVwcutdxvDEtidu4hE/Vyc4neNnJJq3KyiIkVGf8PQsHlqky0jkddAUhqCwVPrz zQzn2luv85Pi19kXvho9zWaxOa5a7gNkQAkXRZQv/2n6R5ELX4mk+H0mp4ogZCtABKIA/FEE5GHpg g72KLUgOdjPt++RxzkyXznumnuDWaTHoPoIIBS1XFKN+9jb+T1zMEwiS2VT+2v2+erDL625HYPQyG AZMV/hMLNiiaeLyecNNMx5aklPToiH7GEuuKcCzl+4fSG8+caTYLjztMPVmDQM29zE+s6INkzJHMR 2iTiYHWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2iF-0001hp-AE; Fri, 10 Aug 2018 08:23:59 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2gg-0007Rf-B1 for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:22:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tD44cwr7sXYWqErJJIfO3Bw2kiDKPPT7OrF4lHBn54Q=; b=XqqOPV8AU36hTtCZqUTgBywnz InDkKapqTQVUZNA7gkRwwXnYoiTIjqmblLdmsuPrBACixST584+rGceYqg6k0+uuNLBwsJFZ3yjyR j9mHIowphiUQ/0hqa7eMHV3amcjRRmhPpjPfS5zK6ybKjhuvOkQaMQnmxrYVAO8CeGTV6UvQBaAgW F9ysYW4gj77dowR1WRQxzcznolVryEVT9TaQQIG000KmynGvt+tVS0Lj8hCO+D97QLslb9pKPD2Z/ 0IvS0NElhlWy1uCeNXlIs+CRbyyFGKK0/Iu8WYWY6Z1//AjUxt5bESYjHQwq37mv0cbAbWD8Z4Hoe k4Tf38WSg==; Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qs-0000SQ-Ux for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:08 +0000 Received: by mail-wm0-x242.google.com with SMTP id s12-v6so936657wmc.0 for ; Fri, 10 Aug 2018 01:05:52 -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=tD44cwr7sXYWqErJJIfO3Bw2kiDKPPT7OrF4lHBn54Q=; b=i7Jvdqv359c3LP6OxStHLZ7WdU4oXFsEe8+hVERmjmFAEBoR8qmvSggSTMdYxFlNkC BCLq7T8HJOrb0i4rZQy24/Afr07dzjSmQXu4d2zbgAdXcsosxzWFMX32XPlnMGR/ZRDq pgXbxP7pTUzvFNsfn1YOSihDxggLE3H132nAUQbJykILNhNssDIBGFOT4/Xxj3iTKw7v +RNlbQbxGNpAmLAtlIhWdgNWmkqUYtl5dtuhzSVrirK1X/fr/uIWQv9Hnw4LMwWjCtcG lzL9KKvAsng4e7nkGXgO0WQA8luehep9Cvfbl4h//9hc15IfokThlYgIhTpe6KnqGlur szkQ== 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=tD44cwr7sXYWqErJJIfO3Bw2kiDKPPT7OrF4lHBn54Q=; b=qlOSYVrQTXgdDnQrTb2wws8FcEZBZ2HizD5kvYPkvqPQuwwYuKRIIX3tFM3s9GZVX1 exG7kBMSFWTiJUqEWb7GIZ6zG5bbhIefT7QICcMrnSD17I0EfuHSxixOutBVUp3Sq/Rs ur83kLPMvRDSG+bZ2AZQwBTzvD38gt1lOLRj+cuc8AgKXVGjGRgRRMsjD7yUZ9+vJgOn VgxmzLzyR7nlsBuUL1OJtVCA7dJ+XMj6rA2rVh8zyDidB1rH3TlsiKOfmOLATDa0iqTn sC7VMJZEPFwNLjzebwlQBwVpuDk9X/qNO5o/+zd5PzwLs0fw/kBaOmbgdG3+wwnGCA02 SSBw== X-Gm-Message-State: AOUpUlGnm6hGthyeT1Yr/pAiW4fQVpvviLMlxaOiSjNhP4Qd1Olug/Iu wu4TdXfJWU4gj+nKMAzHNbSlsQ== X-Google-Smtp-Source: AA+uWPxSqDTuMTV7oYEcvCP+1ZUjY3alEqyp4JhrzX4gBH2zMvJFr39/CHVFYpBBApjiJGLbrz80DQ== X-Received: by 2002:a1c:cf0a:: with SMTP id f10-v6mr762990wmg.32.1533888351724; Fri, 10 Aug 2018 01:05:51 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:51 -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 Subject: [PATCH v2 10/29] ARM: davinci: da830-evm: use nvmem lookup for mac address Date: Fri, 10 Aug 2018 10:05:07 +0200 Message-Id: <20180810080526.27207-11-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_090603_251432_A774ADF1 X-CRM114-Status: GOOD ( 19.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We now support nvmem lookups for machine code. Add a lookup for mac-address. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-da830-evm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 14a6fc061744..9a055ebba081 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -409,6 +410,15 @@ static inline void da830_evm_init_lcdc(int mux_mode) static inline void da830_evm_init_lcdc(int mux_mode) { } #endif +static struct nvmem_cell_lookup da830_evm_mac_address_cell = { + .info = { + .name = "mac-address", + .offset = 0x7f00, + .bytes = ETH_ALEN, + }, + .nvmem_name = "1-00500", +}; + static struct at24_platform_data da830_evm_i2c_eeprom_info = { .byte_len = SZ_256K / 8, .page_size = 64, @@ -618,6 +628,8 @@ static __init void da830_evm_init(void) pr_warn("%s: spi 0 registration failed: %d\n", __func__, ret); regulator_has_full_constraints(); + + nvmem_add_lookup_table(&da830_evm_mac_address_cell, 1); } #ifdef CONFIG_SERIAL_8250_CONSOLE From patchwork Fri Aug 10 08:05:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ED0001057 for ; Fri, 10 Aug 2018 08:08:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB4342B666 for ; Fri, 10 Aug 2018 08:08:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF2D72B672; Fri, 10 Aug 2018 08:08:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7912E2B666 for ; Fri, 10 Aug 2018 08:08:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=32h7EKVe5QROn4CyK3A7APhRd1MexzD7EsuGc6hhZ/E=; b=rExejBFl3357tXb07sNdg3W9GZ 5KwRI9F3oS+T+HMgC4LcvFDx61Df0zeX3TynaP3z0TzzVbNXwgSmkRUFYiEl+qnThYNfSM86QlDEU WGii7k+c4NBh09I0wniKhVXCVSShTU5Pnwz6ejdlb/Uqgh5lfGGXXV3Pdw8W+cQrly8Ud2zS4x/9o 7vdV7V9sNv1kuMhLYvYJNk20wGK6dYslmA85vPkNjGKQFVLYFHS+y3cxv2J5kVew10V3Fn6gMS9VZ /TPzsOhR2h4ghC0chjd1Danw+rM+0Pkw13eR8NE7A/C5xd+9phc5PF+fxUH6SNEHYXLlAn71U2Kxh EIDsjIlQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2TI-0005t8-O9; Fri, 10 Aug 2018 08:08:32 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qv-0002QZ-B1 for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:20 +0000 Received: by mail-wr1-x444.google.com with SMTP id j5-v6so7455414wrr.8 for ; Fri, 10 Aug 2018 01:05:55 -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=bxzAHxBZXjRxHAL9jtG/FK0HAvx9UzeP0h5va0TWUB0=; b=L1fUj1hxtvDEdmNJU7oSl9Zu87psQ9mN+BYuQMmV9OdAN1nOBQ+AEFM9fFW5ry0wTQ QZHF7LAtJ8oBD7VzPOPwcOkALe5JGmaB94B5fBCyNAFd6J/D0/+brCg1r98mH1ty5zPH wr4DdkYYDJGOIM7oIGesWQDssRhswq6aeudoxfAN8OJTcgMpLNTRPZt1fm8gRAOFdH1P mogJFjE9ERXOPDa7N+QSQvQqROs0B9xCPyOAikWsYsD3zYGoZi9n9zhhvSlZfWrXBToh 8+CBFf6IUu+Jap6RecJw+TnTmAoRqAV/unfwokpnk85Cd2U+OKVesvbOfoqh02sOP8+M xEIg== 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=bxzAHxBZXjRxHAL9jtG/FK0HAvx9UzeP0h5va0TWUB0=; b=res8VZupeAJBbIpXMreapj4B2iKtXkaMFkJKRFK/bdL7TUtttM1/yjd72HsMhaAsQS 7DoaUn0CD9K85Mv+PC8aTpzbkZpJcmJAh8YxvYFgS2GFRnZaQP0GLDzCKJPfvLGKL9CJ yAaAFgxGe/7r2+c5xoYmiD0IdYnnS7PdJgJD90GUO3TO4fjEVeh5dgzIrFq3cNnEueH8 HHisgpso4SejLJzQu5Vx0hF+i6C0NMXzpf0HoWwRWkYr0v6+1kP7BLY9WSvCcU2u9nBc n+RJVo2bkWLE30bDly1RYnWfVdLPetG4zNl0TYVNnHvDQV8Mt0wofpj7QkSjeXze3yry TJjw== X-Gm-Message-State: AOUpUlH5GsSBLMZuOIgnxBt2qa3e3MvChShYumelAy79s06rPM+2h/w8 BJi0ZK2j+mXuoby9G1Lzhf7cmw== X-Google-Smtp-Source: AA+uWPwf+1APZ1HtxQTawxEl+j6zYLbTuPRDiWpH5+JVRRKXzlzHEriNln/XMJiahiFWrLevZ538Uw== X-Received: by 2002:adf:9304:: with SMTP id 4-v6mr442888wro.48.1533888353574; Fri, 10 Aug 2018 01:05:53 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:52 -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 Subject: [PATCH v2 11/29] ARM: davinci: mityomapl138: add nvmem cells lookup entries Date: Fri, 10 Aug 2018 10:05:08 +0200 Message-Id: <20180810080526.27207-12-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_010605_877190_4F585CEC X-CRM114-Status: GOOD ( 18.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We now support nvmem lookups for machine code. Add a lookup for mac-address. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-mityomapl138.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 37b3e48a21d1..48a9bae76e4a 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -160,6 +161,25 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context) mityomapl138_cpufreq_init(partnum); } +static struct nvmem_cell_lookup mityomapl138_nvmem_cells[] = { + { + .info = { + .name = "factory-config", + .offset = 0x0, + .bytes = sizeof(struct factory_config), + }, + .nvmem_name = "1-00500", + }, + { + .info = { + .name = "mac-address", + .offset = 0x64, + .bytes = ETH_ALEN, + }, + .nvmem_name = "1-00500", + } +}; + static struct at24_platform_data mityomapl138_fd_chip = { .byte_len = 256, .page_size = 8, @@ -534,6 +554,8 @@ static void __init mityomapl138_init(void) if (ret) pr_warn("spi 1 registration failed: %d\n", ret); + nvmem_add_lookup_table(mityomapl138_nvmem_cells, + ARRAY_SIZE(mityomapl138_nvmem_cells)); mityomapl138_config_emac(); ret = da8xx_register_rtc(); From patchwork Fri Aug 10 08:05:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE72F90E3 for ; Fri, 10 Aug 2018 08:08:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCDC82B666 for ; Fri, 10 Aug 2018 08:08:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0E6C2B671; Fri, 10 Aug 2018 08:08:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 665EE2B674 for ; Fri, 10 Aug 2018 08:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=puzczipEQBsOswmpi0ILu/yjO4wI1TjzkCH2HoWH4SQ=; b=etD9mChG/WUJp8+0AJtS0n6+T8 msFxF95zyw99K3AZTP9HKSKNQjAphYouIRjrFAY6YCSyKVxdJ1Iwb30PYTMGpouUtQK0AGz9SBqav 6vzx/3F4ZS3sERUc1tzVDsdAklaI4UnL8ATskzepRA230FrspCJOM5SWwJwL3YRJwtqb1v85zRWNh 7gsnBCowPtC8SPVwsMV0ZuiquIwqCpV1vvp2cBubOjlWVKlDvjYZOh28/2j8lj7JKslA9im2ZyhuW UsWRuXlqHFTV8p4yMpWBhclok5UTDR1p3ywfMwqn4edM09nLhc24Mqs/Hk4aKGXXLHMaJSixbOmW1 lj6IBdYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2TS-00065e-C8; Fri, 10 Aug 2018 08:08:42 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qx-0002Se-83 for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:27 +0000 Received: by mail-wm0-x244.google.com with SMTP id o11-v6so924369wmh.2 for ; Fri, 10 Aug 2018 01:05:56 -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=sGOzUdYoefHsqeEVpETOZKTrsiIrdDWkhYzQ4MVNoLM=; b=yjBx+zayQEOO94lbibSVMCOe8LuflnszJtTjXhxHxnNAfEX0Xojae3oYWgqq5tkr4d g3vCgx5kKCd3HlMGta/hSDM4hlMZeDKGze9JbxPuf/PDDu8UUkis04ZdQelg1yVeUtFi vk4sUINL4U61Sk9zgsAXBTlIpBRDXknHB8QEQ/fI8sd89ekAa34atOrHYtNajWFOdEH9 HmU/tx9YSxn0rar21U6iq197pLsU+1iYvjlJ9u0elZR2Cq543/JKhyfrkrda/dCICIM4 yE69m7ez2k7oT2VXpmM5FwqHfzFhc9rJkrK9OMEWcJGq6d8d++Po3ma+Qw27WEGDjbkg bVNQ== 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=sGOzUdYoefHsqeEVpETOZKTrsiIrdDWkhYzQ4MVNoLM=; b=qsAl1rhAln1noNy+y/PwZIfuCW3NfOqy50eebtOEvoDZB7Rq6jbK81+jFMFr84PSRJ nYanFdReQ8KvD3z9CsEExxIBtIMnduUmKYzjzvBSt1Gg+eCqpKa4ULE5PmIK5IXd0Yes vVA/tHF7D2l0CZVOX3uNq6qlAgbWV4KC+Dv49njXIFzunVt0fpR2i7672fqyHX0EmikT u/GqFMTHVlA8uA+tOyv6CAF3UrE5O1RS9nlydIrF7fhWYUK9T9Ff1jN3hu6dY/h9HS7e 9HD5XmoMx4TWRza7D840YRVcN7NtbzTHQTz73fi1zgTGITonfeW3gnN9tBCXrl0AWsUj oKuA== X-Gm-Message-State: AOUpUlGBRfdW7N/Xzrq71YEoCuMMrRTFuSadmo/vdUbrz7nF2uY2KMv9 3ScmF3bL/BeZAyQBiYBhW2GD/Q== X-Google-Smtp-Source: AA+uWPx1+GuHuc4EM7u+V6MsXntd+upjbsWfUo0og6CvAQZLwTMMwUiM1O9oh1yLd3hN3xNEEzy9Jg== X-Received: by 2002:a1c:2094:: with SMTP id g142-v6mr731584wmg.144.1533888355605; Fri, 10 Aug 2018 01:05:55 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:54 -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 Subject: [PATCH v2 12/29] ARM: davinci: da850-evm: use nvmem lookup for mac address Date: Fri, 10 Aug 2018 10:05:09 +0200 Message-Id: <20180810080526.27207-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_010607_763315_B7528C7B X-CRM114-Status: GOOD ( 18.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We now support nvmem lookups for machine code. Add a lookup for mac-address. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-da850-evm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 6d5beb11bd96..5a634a04ec69 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -99,6 +100,19 @@ static struct mtd_partition da850evm_spiflash_part[] = { }, }; +static struct nvmem_cell_lookup da850evm_mac_address_cell = { + .info = { + .name = "mac-address", + .offset = 0x0, + .bytes = ETH_ALEN, + }, + /* + * The nvmem name differs from the partition name because of the + * internal works of the nvmem framework. + */ + .nvmem_name = "MAC-Address0", +}; + static struct flash_platform_data da850evm_spiflash_data = { .name = "m25p80", .parts = da850evm_spiflash_part, @@ -1447,6 +1461,8 @@ static __init void da850_evm_init(void) pr_warn("%s: spi info registration failed: %d\n", __func__, ret); + nvmem_add_lookup_table(&da850evm_mac_address_cell, 1); + ret = da8xx_register_spi_bus(1, ARRAY_SIZE(da850evm_spi_info)); if (ret) pr_warn("%s: SPI 1 registration failed: %d\n", __func__, ret); From patchwork Fri Aug 10 08:05:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562445 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32D791390 for ; Fri, 10 Aug 2018 08:23:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21A222881D for ; Fri, 10 Aug 2018 08:23:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 149DD2B3DE; Fri, 10 Aug 2018 08:23:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B75642881D for ; Fri, 10 Aug 2018 08:23:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XC++8yxyME0DI2UlDQhnFGNU+iGN+n7k1mjvptPoD0U=; b=fJ2vXfSwHimnNSHWucbQs1NUAc KHC3XZJA58P59dKYUP15pDgZ73Yiq21hsgiCwoXfb4z+mUBlazodZ4QXzq9udn3ic2SUBlqii7LzM W1w58GymWEapmkZce1yzjiApQWy6c1xQtyB8sRI1tZ6ecp0b7T/rPy4QEU1jSxZcU1d5pLtb9gmVp PekV2k0KinMVJ1G67ZndjvK0Ig5za+otUdMrepd+3rYZAEdjG0tIoz9z3wHWL1/9hi7vHJmXiAzbE BJrBCpY7t4fOxHoBHZuuJ6aZYH9kw/kolkLjcRW0mlcJF1sL0q6SdR0WY5K1Mg9mJSo1VcL23wPAZ L0wf/d5w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2i2-0001Iz-8b; Fri, 10 Aug 2018 08:23:46 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2gf-0007WM-7x for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:22:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Vbd/0hAQ6eCPDyxiTiuvrAkBoIff8s2ba/U1T9sJXTg=; b=NZWhix+fd1gzdzTtsTYJ3IBcQ lgnDgz6+sGGJAm0I4dK4PphvM3LiHhdlhGGVdzFZZXqpGiULloHW06Y2IY3yA6XzLANYCW+BHvg2X lbriPRnnL+uVYUr7zrgqu8RntvyRTa633S5yfe5SzoKiOhffrMeg0olLQ/h4fUP3I3UWfAy0yGmpb 55GJJhiQYyen8QpjM45KT/7N8wYkvOONfA6hdBVumoutjslP+FrvGKzVdhkCvuSX19f7xAuysk7ba aliTinZTw+756gOzHWi0Jg6YNoWKrZfBcO7nrkb/nhEDAXF7JmvW8U+gFEJa4y6FdGOfUFBje4kWH 3zbl+qAEg==; Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qy-0000Tu-MT for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:10 +0000 Received: by mail-wm0-x230.google.com with SMTP id r24-v6so777017wmh.0 for ; Fri, 10 Aug 2018 01:05:58 -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=Vbd/0hAQ6eCPDyxiTiuvrAkBoIff8s2ba/U1T9sJXTg=; b=WXTaSryWR9CEYrjcNIo3UE5DtLYVKzLIWsj+6TZ2+rPbEG/Yh5qafUI1htgP0u5l5M 8CL9+bQBZT1ilBuuK+swWtl13ZX4Z6gOJz9Elduk/Q2SDVrS7IhQBp7/qAbPVaprWw+E qnuyZVLHRlSl96tEGph9PAvUv/tYPBsSe8xFsVLr6PiQDRIKDNYLRYtfBnqVqVeeBLUu WZe6k76TwxoChB83iOgCkPg2lJ7w951xHcPU3lAk1ccOIQFMZ+MZBVRN7Xl6MPbrJdFL FA9BLxZp8nf/vLEhYrrgY2IHv2KlkYuCMkEkC0SQ2T5n26mkbWlELxvvu5MDON2LDCZP Hxig== 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=Vbd/0hAQ6eCPDyxiTiuvrAkBoIff8s2ba/U1T9sJXTg=; b=hfAE32D7Y09eURO2w2na2Gldzpo4nGhPPEq/pEdYzC9hmvKfZYyOJP2wsGUlASnkPw Se95OTO49ofwYegLOZAZ7ghl6jBOROEv+JijMXPVMTZVoej5gvlXZq6jQz42ONegMUyo DKf/dCWL9BNE+BGZQdy7Cd2Ppj8YLLmuZ50Pis0sfkvMvnuFi0IUmOalNsfgftAyQHHR rXq+SiWhG6T99sMcg6/iZBN/STlfz3K0j+lfzV5fAFBEKdb60hXGiyLu96ZfHLtSdmyu 2903vSTO0SXHmb24YCHk++3+wNp15UbdmaB92cpgKA6z/0+bgyfxHU96el0Yx7sq7Ouv LKSw== X-Gm-Message-State: AOUpUlHaWYy4fvGZ4959MStnaJoFof1lFXwSAur7hETmuHsB93iXUn8l q7tiZoPClW3HURVH5erqL6msNA== X-Google-Smtp-Source: AA+uWPwevt7H+4psNa6nNW0sB6RMqRzZSdo/PB1RqE6sIHuds28NM2mVCOs48EMlZ/vnaPtG0JWFww== X-Received: by 2002:a1c:8b0d:: with SMTP id n13-v6mr730206wmd.46.1533888357383; Fri, 10 Aug 2018 01:05:57 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:56 -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 Subject: [PATCH v2 13/29] ARM: davinci: da850-evm: remove unnecessary include Date: Fri, 10 Aug 2018 10:05:10 +0200 Message-Id: <20180810080526.27207-14-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_090608_736892_4CB88D12 X-CRM114-Status: GOOD ( 17.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski The include file for at24_platform_data is not needed in this file. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-da850-evm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 5a634a04ec69..521a26b5c20d 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include From patchwork Fri Aug 10 08:05:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562499 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0CE9F157B for ; Fri, 10 Aug 2018 09:11:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBD792B883 for ; Fri, 10 Aug 2018 09:11:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E78822B8C9; Fri, 10 Aug 2018 09:11:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 998332B883 for ; Fri, 10 Aug 2018 09:11:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=CduWvLPrBKF265HF8Q6yRF2vmh74Dm/7H6BZ5CGPUcY=; b=ct61luF/Z93vu4gQQLgvPItG8p JCJXq5x/PX/O3vqC1+loBYQu6l9isBXk1/tcZD4sXZNaJnOU+3j+YzlzJBfr6UvCaSYBzYoRr7HQ4 HEY676oXyHLGLv3kZoNNRRSm/5WmskCka4igmXnfLBb+Xvti100OfEFFkOM1kOdD7aYQ3fb9EZnyn skXPwBQf4iSoe/uWculPPuEtehsgYKmjstEOZ1O2s/G5sT6sz1ixmFlUkAK0JcLbUgl8Uhiy6vfda y0/l59tGJ9hV47WVHnU/3wGi1cXrUpNRQ88/h54YX9rV0Rb2f53Pn5BNaodbEAljH7KmDRvqPXXl1 PkNvQA1A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3Rs-00036A-8V; Fri, 10 Aug 2018 09:11:08 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3BR-0007pj-Fc for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:54:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HVcV+D9oE5OwLHTLo/qKvbgd6WX5oO3G+bmGYBBY+LM=; b=zdcBD6/Xv97yK4ZAqcGiZah+L 363BA8Jp99Ix1QHYAOolKE/evhd9ZiMY50/iYCRwAKrrFOf+/3wArlpyKivxDhIUiS6qQwK2AJ3K6 OytfwOCRaiHMTAMJ38iSlm86rw55NBBWxpnMzUbvIdHuViK7p5fDh6zQMoZXcugEQGgsK68cgnEWF qISS3msURB9h462/bACRMzx7T3cakjk1OQFdnxqATh/jA4aoWki+o8zm7Qhsy/BjMuqV3azbMvRu9 pgLuP6EZH+mVw/Dsdlul1T089NeBvkvCvGxqaMI1Nf5sP6oFSXlnNugomDChyIltqvn7kwMarFZAv 2PHy77pOg==; Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2R2-0007Wa-Ej for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:14 +0000 Received: by mail-wr1-x436.google.com with SMTP id c13-v6so7496327wrt.1 for ; Fri, 10 Aug 2018 01:06:01 -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=HVcV+D9oE5OwLHTLo/qKvbgd6WX5oO3G+bmGYBBY+LM=; b=bhFAgZ5hHjjTrwrl1iOBbafXfBDZiTPhqPFI3NNgnioBKDQ9cc/2d9WiTpA060hA31 dvp9PdgR/uW2GaC/OfRLieKDN2frM/haHRGaGTfW61Gb9dqlssGutnim8Wr0rUiK2KWH xHoM/SWqCl0FxIazn4IPWAC1uvLuPN/QbBUwVgXVuI6CbZvMWJRcAqYn2UJMZ+Jrg41p ZIuLV4F6xKtofc6znzidBFHaUZ458NXJnukAgkkbkI82sWb5xlYEMW2o0b58czd1clnl j+Drc3J+KuvjnViTb2VpM2V0LP2JjL+1wK7CiLodtIYRrBzFwebqEbHStVGZF/kmONeF POlA== 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=HVcV+D9oE5OwLHTLo/qKvbgd6WX5oO3G+bmGYBBY+LM=; b=hibBgftHlzkC0BCnVOfB5sDVQYC1AWm2bFBqfbcD+jLPs9GJaz0evpK4zFQtkKrD2F lK9F39lm9sYWKwSJrVIGRPFkfDHyUkoFlUZj4rW/WoRr3tKzt6u3orc/Jcs2sOeHbjJS 2daFPe+rVe76dinmalA0zKlmK5/sCPo33RidxXlsU3MBB/2Zp/4AluAWQF3A1fCvNzL2 ntOUNxJ9Prdks/i9OiFW/IEINt/oKbivoqCvy4orI6lcsHcfHQ1XrNU8lIotl0ssAFe0 vSn9hycyGxn6JTk1CQAa1NmpC8Ie3BTlq/MrIAZuPYXYSenvqNfV07UM5qXDpUFz9nb2 WARQ== X-Gm-Message-State: AOUpUlFMZwzrFO/G885fG0iwSgcakERh/IaQcAIz9y/OF4oe+XYe0+SO 5fH5j8Hhs0m2MOAFEyPu1kT7Qw== X-Google-Smtp-Source: AA+uWPyBdjVAqNR/3A8sojlKFsQmP5DkUM6AEbLZ9dYbBKm/fehxDFZKubc2KMb2IL1kO7W4wKMBJA== X-Received: by 2002:a5d:458b:: with SMTP id p11-v6mr3508671wrq.122.1533888359309; Fri, 10 Aug 2018 01:05:59 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:58 -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 Subject: [PATCH v2 14/29] net: simplify eth_platform_get_mac_address() Date: Fri, 10 Aug 2018 10:05:11 +0200 Message-Id: <20180810080526.27207-15-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_040612_545787_C94D78DE X-CRM114-Status: GOOD ( 15.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We don't need to use pci_device_to_OF_node() - we can retrieve dev->of_node directly even for pci devices. Suggested-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski --- net/ethernet/eth.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index ee28440f57c5..7f08105402c8 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -530,11 +530,7 @@ int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr) const unsigned char *addr; struct device_node *dp; - if (dev_is_pci(dev)) - dp = pci_device_to_OF_node(to_pci_dev(dev)); - else - dp = dev->of_node; - + dp = dev->of_node; addr = NULL; if (dp) addr = of_get_mac_address(dp); From patchwork Fri Aug 10 08:05:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562495 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D1137139A for ; Fri, 10 Aug 2018 09:11:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C116E2B8AD for ; Fri, 10 Aug 2018 09:11:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD7EF2B8B5; Fri, 10 Aug 2018 09:11:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E0032B8D6 for ; Fri, 10 Aug 2018 09:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=wTMeBoMv+JmcmC3Cr9M7IyUIQHWfoX5vo4tBNs8d15Y=; b=ktqB3vrX0k6yODlxbvYqibR+w9 iALhkft6I1SUwgDXjfMSvCTgyouMbTWlxETyC0UZ553MHd5yTEupxWtUWSzAruIqrKb7DkL4d0mk6 C7u/5BiMMczra5YmNcGkxwaheLNIEdI3kiqMXmPA5qZjNEpptfKExP3g768yndKYCtzQxo552IPlE 38ASMgY2QzmLjvpah65vYmb2AV04h+NQsC2OiBbFYjkcBusSQzC+RkQLuj3GPeI2tA8JytOQ4uqZO LaQJnklufl24M1oL6Fj63NAAiYM0k7ABa7eHAyRDBOv8S3puerb5rRZzCfMDlcAGjY4/5BRcyaPVJ 0vTCzunA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3Rl-0002xN-3Q; Fri, 10 Aug 2018 09:11:01 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3BL-0007pj-5I for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:54:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EjOQubnQTroWVxsDBUM1JXSo0fAS57WaAUjmLBb4Sws=; b=mMC3opYIE5xzGnygFPutfGoeR pGmjR86yYtl2EmqZkLjPNtRfMrLi4J7dMiZIDmKZhsXkpyF4hQ+T2Jw0kQRKKqshD+qman+4R0aWE +TQQvlClFThybSUdQ0ZBW+rY3/ukS3g4dbHUsf7BFfY1/LawgMuxXAMqDJc780YU2doY/bXsu/OXy G40/YM55m3hAqDkmH2cmonVolGM8/eeYDdQBjAIVrLVYtL28Nbc0Q2+xmZLzUK/En6tRuHko5/Mng wJdGOlVAnIW9y/naAbwaPIy9NAJGSgrta7HXftb2htzf46sREQtFwESogwSaOG6z0qLt5tOVrJac6 ZCoJD+9jA==; Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2R4-0007Wt-Qc for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:17 +0000 Received: by mail-wr1-x444.google.com with SMTP id h10-v6so7462276wre.6 for ; Fri, 10 Aug 2018 01:06:02 -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=EjOQubnQTroWVxsDBUM1JXSo0fAS57WaAUjmLBb4Sws=; b=slxAavyRYIQAKAyGAcvJcsdh4bzGKFYXvueiQKixAAkrgMWIfSf1b7VJfMW8yml9CP OlkK3rH0fn7Cp+JOjH+OwKI3DlTgq14HaQgshBSfsWcCVIxRtuP1Tb8j4e1sh3PgBane I5druFmkEsk+6QWmtgkkzuNEX3y6ct8hPvQl+trAkKGjltR0bN4am01ohGLiYfWiIVHf mP1hXPsUie4ZzSKNpP0Ba5pHkzO08Gz7ktUz2eV5J29se9aqmHvVO7Z3qIYUxrUcfOlz BmrOC1ajt2D1hEHzj3h5Omy4PBimrql7pMsm5V3KdV2T1VuHIvws9axLTyMd2zvu0LW2 Lhkw== 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=EjOQubnQTroWVxsDBUM1JXSo0fAS57WaAUjmLBb4Sws=; b=PctikRxpPHA2wL/l1fvzyqT7jVfJjzh4r8QpIS9vwIvYW4oC37QnGznwDZIopSxqkF tk5FMBfxUcQWKTcgw7VsW2mi+3+WehGEMxGpl5jzmHS5llAOqWk9MOmHfVxt7OxLnZV/ 4BlMon+lx1FbCQjfUxF5CXdBnUcfqy1/YexA29hRWvQIs8lb+0GTz60Nz7noTHdQ3wDh HW1Z4AJZBZJKR+De9iRz8ujNrC+7QUdUUtmdhj4sbaqpyZ7Am3wSYmSjFl4Id/HD1BhK Gx4anPQ+mg9kEfDjDqaqGB2dT8evOFSoHwmo8PZWVSO+qN4bQHE/bFZm+4c7Wlr5pp+G c0Rg== X-Gm-Message-State: AOUpUlF4+uALrRB5iiAX80oPiXELWKr0m4X34AyKJIJH56u0DnPwaFri bkzOB+OO55O/ayoDyo43pkh84g== X-Google-Smtp-Source: AA+uWPy4GNYeh2WzvM+2T0Bc7L9+oHxywgRRtH1zE1aqpVG7uIW5FR9RKpaa87lEDy5+MnJSrszRTQ== X-Received: by 2002:adf:8385:: with SMTP id 5-v6mr3547900wre.13.1533888361189; Fri, 10 Aug 2018 01:06:01 -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 h7-v6sm9546405wrs.8.2018.08.10.01.05.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:00 -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 Subject: [PATCH v2 15/29] net: split eth_platform_get_mac_address() into subroutines Date: Fri, 10 Aug 2018 10:05:12 +0200 Message-Id: <20180810080526.27207-16-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_040615_053259_82865316 X-CRM114-Status: GOOD ( 18.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We want do add more sources from which to read the MAC address. In order to avoid bloating this function too much, start by splitting it into subroutines, each of which takes care of reading the MAC from one source. Signed-off-by: Bartosz Golaszewski --- net/ethernet/eth.c | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 7f08105402c8..d01dd55de037 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -525,22 +525,50 @@ unsigned char * __weak arch_get_platform_mac_address(void) return NULL; } -int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr) +static int mac_address_from_of(struct device *dev, u8 *mac_addr) { const unsigned char *addr; - struct device_node *dp; + struct device_node *np; - dp = dev->of_node; - addr = NULL; - if (dp) - addr = of_get_mac_address(dp); - if (!addr) - addr = arch_get_platform_mac_address(); + np = dev->of_node; + if (!np) + return -ENODEV; + addr = of_get_mac_address(np); if (!addr) return -ENODEV; + if (!addr || !is_valid_ether_addr(addr)) + return -ENODEV; + ether_addr_copy(mac_addr, addr); return 0; } + +static int mac_address_from_arch(u8 *mac_addr) +{ + const unsigned char *addr; + + addr = arch_get_platform_mac_address(); + if (!addr || !is_valid_ether_addr(addr)) + return -ENODEV; + + ether_addr_copy(mac_addr, addr); + return 0; +} + +int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr) +{ + int rv; + + rv = mac_address_from_of(dev, mac_addr); + if (!rv) + return 0; + + rv = mac_address_from_arch(mac_addr); + if (!rv) + return 0; + + return -ENODEV; +} EXPORT_SYMBOL(eth_platform_get_mac_address); From patchwork Fri Aug 10 08:05:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6918D90E3 for ; Fri, 10 Aug 2018 08:56:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 548802B838 for ; Fri, 10 Aug 2018 08:56:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47E6F2B862; Fri, 10 Aug 2018 08:56:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D026A2B838 for ; Fri, 10 Aug 2018 08:56:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MnfIu6XZ3s7ULKrGHTZxWZPxUQr3HxSho6mGpyI+7rA=; b=c3vT4gcf9q3FdP8IUi7MFIkFQ2 J/OssZS0K2dLtdPiy0k/WLBoqKXtHHpmz7johBy5MaQWLo3D8c7uMqlSLQwLrTsqFqRNlf+i9q1GT 7qndgGs6ZT6CTsO94Q6CcdeZ7HnV4FntaETy/4V9hPJoBT+pIywmJtAKLQ+dY/XpYfzK3aweiSoau SGVK37kDaOggGRPpA+KPkRgulo/5cq10nVIHVCnuIg4nCfcXqt99lZHaueZigH64fJbLx74UAwEU0 T1ngjQvOYinlghpxrePI5cVWnfRDBngqyYbHB9u04nxJKsuxbOlr7Ezl2+5tm9yFnK1O9wsQscgMj HCt3F7dw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3Dd-0003w2-T1; Fri, 10 Aug 2018 08:56:25 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3BI-0007pj-1R for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:54:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=xBCyNbNCPITfm/FYEaMd+IK4mUMo7ZN7E7Ko6Q08LvM=; b=K7ZNN5dwWIv/Xaad4IcerjCQ3 5LEMmykNfnnVnsUq3z9+t7t7Hd8ZDH1ZtvFxNPjpfsXoGJzc8sI8w+E0+iushM19fT8hE98GGGuk+ xBE5QuhcOzutyjtzzIz7pIKnfHDQUHjQ5v43FuWL8CA6LmgcJ+7vTfdYI/yncbMealmdUfAF9nfxs KEU7E3ns6PmE8hVJlHGZekXqD1bBivPvMh42EnT/ZLWPCSm58wKtu+V8dhdTHGz1PfaAVXgn/Pu7l CCCQoyBmjvmxXGxb9SeUiM0SmiByvHF/xkplVnC5ma5wWoGa+c+ubOegOkSxKttMyP5KpHn+qtWPX eAxQZGg+Q==; Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2R5-0007Wx-TD for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:17 +0000 Received: by mail-wm0-x242.google.com with SMTP id w24-v6so937813wmc.1 for ; Fri, 10 Aug 2018 01:06:04 -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=xBCyNbNCPITfm/FYEaMd+IK4mUMo7ZN7E7Ko6Q08LvM=; b=ZoSD+iUvQYCrkYLzuxLovIKe7P6g1SzIAaKg1KbZIqH8t+2kAOF4XKmk+NS1KXP6vF cPNFZ3Sc5sxKFR7uxTY7nwe7P4/pvzM2LPPB/0tX4nDr18PB5QsFaLhTOfVd4kwty3rk p6PtvVnld4i7zINBC1jaxatDY0l7Tyrk9U8neYeEVBxVpX5T3YlzC6n/X2/c0uUYyviZ LRNQz26ewZJW/BuDz2Fxfkmy/IeqdITTUyn9x3U4Ul+cME/zYMWcgBuo+2+ksEKtrYfo k/nn30kdsam5V6Gte4JXQF60uB1EMrbabLMexof3N8qTZ4NWJxA//9s1o5oordEMLuwd Ar+w== 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=xBCyNbNCPITfm/FYEaMd+IK4mUMo7ZN7E7Ko6Q08LvM=; b=TDUYso8UNVlyOJe4Yx46IDz22dT0AsYtosnygY2QA+yv5jEn1m0Ajwy0+AtMEakTfI kA/dqlhsIQyCv/AM1vC34zlFIwye79fUUweChw0WqVBJEObAlEXlGK/bsAYjoomaz1Dk HYorY83dNi4xEa+tr1COSYjWO4rw1maDEUywj45Fl9tzvY+R+rO4/4s1MFzGvv1GOTT3 L9ylr+fxXs4hZmlYyIb2MFIVn0Ou2XoGTS871VLdQEU1/cngCkeYt6QA6btwmDVzuVeQ NAgHuiSfnfX1d6vVAresyeKnVjfeNURYyBDY6BmUYqkbZ7r0rIT6/R28mGqmAVUJ3B5l EBHA== X-Gm-Message-State: AOUpUlFuFfIKjs+4AqiLz0vjd06g9szvkyPGDJ084CqCADzn+zUybTKl bbggfazfmwySnhKMtdSaKDzDVA== X-Google-Smtp-Source: AA+uWPwkRZbXh5LSdlohK1hTKspc6zrxfOZHz6Dm0nnhPL1EtFPJittRNfRlO54QLRBPf0Hyd4OjWQ== X-Received: by 2002:a1c:5bc7:: with SMTP id p190-v6mr775080wmb.101.1533888363093; Fri, 10 Aug 2018 01:06:03 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:02 -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 Subject: [PATCH v2 16/29] net: add support for nvmem to eth_platform_get_mac_address() Date: Fri, 10 Aug 2018 10:05:13 +0200 Message-Id: <20180810080526.27207-17-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_040616_165328_A104E652 X-CRM114-Status: GOOD ( 20.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski Many non-DT platforms read the MAC address from EEPROM. Usually it's either done with callbacks defined in board files or from SoC-specific ethernet drivers. In order to generalize this, try to read the MAC from nvmem in eth_platform_get_mac_address() using a standard lookup name: "mac-address". Signed-off-by: Bartosz Golaszewski --- net/ethernet/eth.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index d01dd55de037..f6f6af05fb58 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -557,6 +558,39 @@ static int mac_address_from_arch(u8 *mac_addr) return 0; } +static int mac_address_from_nvmem(struct device *dev, u8 *mac_addr) +{ + const unsigned char *addr; + struct nvmem_cell *cell; + size_t alen; + int rv = 0; + + cell = nvmem_cell_get(dev, "mac-address"); + if (IS_ERR(cell)) + return PTR_ERR(cell); + + addr = nvmem_cell_read(cell, &alen); + if (IS_ERR(addr)) { + rv = PTR_ERR(addr); + goto put_nvmem; + } + + if (alen != ETH_ALEN || !is_valid_ether_addr(addr)) { + rv = -ENODEV; + goto free_addr; + } + + ether_addr_copy(mac_addr, addr); + +free_addr: + kfree(addr); + +put_nvmem: + nvmem_cell_put(cell); + + return rv; +} + int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr) { int rv; @@ -569,6 +603,10 @@ int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr) if (!rv) return 0; + rv = mac_address_from_nvmem(dev, mac_addr); + if (!rv) + return 0; + return -ENODEV; } EXPORT_SYMBOL(eth_platform_get_mac_address); From patchwork Fri Aug 10 08:05:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E8E61390 for ; Fri, 10 Aug 2018 08:23:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AD3A2881D for ; Fri, 10 Aug 2018 08:23:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F07DF2B3DE; Fri, 10 Aug 2018 08:23:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 960F32881D for ; Fri, 10 Aug 2018 08:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=yPT43/R2ngUwf6MNcwcE9DygpQA9pKdjL783bjpY1Gg=; b=Q0G5/S0NPTvL0WBMlyAdsz9bAk aEwUNbzaQFsz40in6SXIIrczuWy1cqIwMd0EAVBziwvSMxkEXkKeKLtiwkh884U1x+1yaLUalHsbf 3gUiSw0YkME71eJ3KSAKSR0XeFNqyYPLqvUFDqfZPJjyziaNwDK8t5kOQG+1zDj+ORwcYLg/g20GR 0mAugjS+1CSm+thZmX96EHOM28JNR36VlY57qDDbX8Rgr3eP8pjICfENVzY+hibz2s1YhFrEtvAPf I2dsF7zSWUfvlOTZmNzTOgCPXYJoykRcw7bp2b0esMZecoVMZibZiFtSHBOK+Yxw0q4Y0tenu9TxE J1VL4KYA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2hp-0000tV-6b; Fri, 10 Aug 2018 08:23:33 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2ge-0007aF-Q6 for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:22:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8UdSyH1lOqINYeO+r/ZsFoxAxuXuxmjPqoo8dlrZx/U=; b=Qg9l1vkeVBiahB3DJm4qmc0vN FJ2BOGO/l2Ydl05FNITBbtyOJ0SkVS5T8ZOSqHQd7r+XrKVau49CyqAkOYUSw4SwD3kCUp8dsXrW6 /jmSzZr9BsVxPlVw5oWNTq1OJwbA3t18JnC193YTSRADZvrZjvpzdlbEjOxLRex3bcFj5fAr3MOg6 gOGQIAJ8B3IIpWBX0pSexEkBtERbQFxtXjr/j9FqxVQSyI32swJKVeURwwyOmH60hoicSV4X38K4Y 0nf0q0LLoTCKdgHAKKlSk+drwiCX9e3XtpEZidAeOKsHaKM2bC9DkYh1EAJNOnd1USRI7wKKwbBwR Ug73/4i1w==; Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2R5-0000YN-RR for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:17 +0000 Received: by mail-wr1-x442.google.com with SMTP id b15-v6so7447440wrv.10 for ; Fri, 10 Aug 2018 01:06:05 -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=8UdSyH1lOqINYeO+r/ZsFoxAxuXuxmjPqoo8dlrZx/U=; b=mt/KXDC4nfdwHLn2XlDBPM4y81ESlrV3OFQmRIJZkcXOGIiUGUng/VBMv8ne3TnYv/ AvKnsmK7kSXDKQpprVm4gAMTFMkx/qqFRaME6gp/TWgjRkeX6F57yIdIkvtnI16GWvyW qo2U5hnq5J1zzVsY8RFdkrOUyndUEOpQ4osdUWOZAO/uu9t2gNgoatiIyHyyH1k8bc+0 vr6GHJJkNiqTgZCHTDC14/Wx6wiNwKD5BMJV0W0m5E9sExbUqWganevGnP9mSmw2N/TO tHJm2ssDpmKuKzflbSb1q1g8LcF5w9GyRfGnjNs93IaD/bDN6iJuZ7zU068+hpt4Mc++ noEw== 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=8UdSyH1lOqINYeO+r/ZsFoxAxuXuxmjPqoo8dlrZx/U=; b=SnG280SEg9gHu80+Kh492n5IJByRz9KAXQ7JSf2nRWvJv+IPcRM0ujPjTfXnIrtt3W xn8hz8NWI02kxhcn9fT1Fqy48tzRNaSSRbzd9JcKadWRn6EjKtpVYjnrQcUqjLCiIhEh mysutx5s9Qz9tmOZqhrzCiI1nUmIlTWpY6d9EzuvZ3UA1+ymYCMVorDf3IsaZpMf3WtI H3NZyrHxKxtStYckCi1upQ6d7Zv/zTRK80fxHVY3+srXtlIvswFtbDNnsIScy9Msy5Wv QHffqEVQXB03crb7Mew+gOIKIojmPibr3we6YJLScjRqIIalQZ1BXovm9+qBp7Y0+V2u uY3A== X-Gm-Message-State: AOUpUlFW45j0SfI2YG3fOkXYzEhyTHQ7GDwjxthucHYvtje27fBg4Gyl lJ5Gb/70nG/1NlL4sh2pdzTk7w== X-Google-Smtp-Source: AA+uWPwXvALBFOFWa75Ks0v22iEu5lNMBTlP+OzTuPP/ZK9R0ES25xlWVEHr5kXFii1o2Do3GQC7Tw== X-Received: by 2002:adf:fe8f:: with SMTP id l15-v6mr3583225wrr.165.1533888364864; Fri, 10 Aug 2018 01:06:04 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:04 -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 Subject: [PATCH v2 17/29] net: davinci_emac: use eth_platform_get_mac_address() Date: Fri, 10 Aug 2018 10:05:14 +0200 Message-Id: <20180810080526.27207-18-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_090615_888173_EC4DD570 X-CRM114-Status: GOOD ( 20.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We now support nvmem in eth_platform_get_mac_address() and all boards have the mac-address cells defined. Stop getting the MAC from pdata and use the dedicated helper. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/ti/davinci_emac.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index f270beebb428..5d01bad4baa5 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -1700,7 +1700,6 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv) const struct of_device_id *match; const struct emac_platform_data *auxdata; struct emac_platform_data *pdata = NULL; - const u8 *mac_addr; if (!IS_ENABLED(CONFIG_OF) || !pdev->dev.of_node) return dev_get_platdata(&pdev->dev); @@ -1712,12 +1711,6 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv) np = pdev->dev.of_node; pdata->version = EMAC_VERSION_2; - if (!is_valid_ether_addr(pdata->mac_addr)) { - mac_addr = of_get_mac_address(np); - if (mac_addr) - ether_addr_copy(pdata->mac_addr, mac_addr); - } - of_property_read_u32(np, "ti,davinci-ctrl-reg-offset", &pdata->ctrl_reg_offset); @@ -1819,8 +1812,11 @@ static int davinci_emac_probe(struct platform_device *pdev) goto err_free_netdev; } + rc = eth_platform_get_mac_address(&pdev->dev, priv->mac_addr); + if (rc == -EPROBE_DEFER) + return -EPROBE_DEFER; /* We'll get the MAC address later. */ + /* MAC addr and PHY mask , RMII enable info from platform_data */ - memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN); priv->phy_id = pdata->phy_id; priv->rmii_en = pdata->rmii_en; priv->version = pdata->version; From patchwork Fri Aug 10 08:05:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F40214C0 for ; Fri, 10 Aug 2018 08:23:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B0F72881D for ; Fri, 10 Aug 2018 08:23:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D242289A9; Fri, 10 Aug 2018 08:23:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0CD8E2881D for ; Fri, 10 Aug 2018 08:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=bIVmwEqrFdlbNXsvSCu/mLqUtd5LC9AfUCvjGQMvgoA=; b=ZI8caU+2A1MWrdMShxQcQiqpc3 XRAmlYXCQSRDevYMaVsWxmuJwjbTrdMwUysNB/INHQ5ronjUGOH5Nol6/2db+fqMcqErl85vFF8uJ 9lMTXeqU3A1f58A6bx1SL1RWrHHVKm1cd89rGm41zIgjl8xrG0FpZpgq8GltM9v/tNYtUAITPHIE0 oTuJjG1l03XCCIKpMxrVgfvpKsHmCDDPM6rq5yrvKqN44om9TZwSZWqstVbHwifd80CaC8YiXj7We E/yh/cvMuWI2p2MRwNIEpr5edP6/V1N/FyU/5JNVdBSeXmYq7Gyv16bHtT0MixjoZRxY/CdMYD5G5 6HfgU4oA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2hS-0000Ml-H8; Fri, 10 Aug 2018 08:23:10 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2gc-0007WM-Ud for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:22:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=r2kUHt8xOX/X/PnpUK/Av4k3yjo3y+RVMVX0DZ8RBXo=; b=uTaIoBcnXc7RB822M5p9+Edfa Z1Supi08OWVuJoFOrTFMafVTp+FN0LnVOS0ri56C903G7fkptsMuKsns2zS/3Y3wbGdCiqfMV3BRe l0xuESHPJD/4raNH221JSP5N70U+MAHrzPFZP89lIgKfLTfDWE7PSIM7N/za6nC3DYzhqju2kFSFL GdYXP5iamMZik24O9bau55dhiuKdSWavLnIsqmxr1uJN3l/bSgdNl4a/OCTpXSxaNnwOjcmCtDyP5 eRMvMbbY/ittQXYptt+eVtQZIT0BGUFYWN3a4ul62m/5M36LkrIB11ONpL5vGALf14aHyuqMBxnUD kG5KJgnOA==; Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2R8-0000ZS-VD for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:24 +0000 Received: by mail-wm0-x22b.google.com with SMTP id c14-v6so920643wmb.4 for ; Fri, 10 Aug 2018 01:06:08 -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=r2kUHt8xOX/X/PnpUK/Av4k3yjo3y+RVMVX0DZ8RBXo=; b=1IezMsPvfeCSNwxz/W7g8guUWIj1MlKn1Y/XH0QHuzFMya6wnUXorRPiYypsD6lbLg gFHq/HzljmuSs7G/4V66s0jCYV/eX55xvrzDQFbLzXBfTSQ6bx5akAyYMzK2+rSdgnLE 2syRCvvfjtYgr5FSpZG1euQg55osIUDpajdFLgLu/9GA+6uHpzcADzpxeeAaECNPVjMd 8qLN2ZTufzsNa6IsRDTCd3tFKm2w6zazU6l2lxEVxVHmht4uK4hu/cK6H2bbp8X1/lxg RxxwhI+KPGkpj8IqzGLlOI4lpgpM8XpHXOHFKFGkjO6nTIAPM7UqMhWaNBOudfwVLM2K SuqA== 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=r2kUHt8xOX/X/PnpUK/Av4k3yjo3y+RVMVX0DZ8RBXo=; b=JoruV5RwkHRml4UY2QT9jZUvfZVtPDeCk8SCFQwqWKhrAsWu4ehQRRK4BlVZY6GLT2 81ya3uR1tOG6kyJ2qv9gCUiCI4s+Cvo2gCpPvcxhnCkedRKluYejKQ8XN4LimHvCAaAW lgMMSz885Bsb9kETiLTQAD//yNoLygWE++H5Op3Iz//gE+LkKiKcP+2/kaWpXrS7tJdi BUjHiFaZHn2iKFqStPvnDTXXKeLrUCsaKE6XMufGA+Vwh35BVGYJYwQZPOJNT6z5IEx7 3xg/0eanmHkFZzqxR1C+fZogn8aE+MXEM3KPJQBscP45roN1l1ENN67loe4v0Dx+++LS aO/Q== X-Gm-Message-State: AOUpUlGd66E+BRiwno4EjD6F1IFyYfPERMFKFfrfvwHArN57bEqjw6Gl fgOvZHIazlvDqcVc8QfKctRohw== X-Google-Smtp-Source: AA+uWPxWBZF891XRgjDhENshzdI9BBPFzNgjARcveCg1grLiyw8JKPh+e10lACy6aZz5pXAQkYfpjw== X-Received: by 2002:a1c:af53:: with SMTP id y80-v6mr746588wme.55.1533888366699; Fri, 10 Aug 2018 01:06:06 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:06 -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 Subject: [PATCH v2 18/29] ARM: davinci: da850-evm: remove dead MTD code Date: Fri, 10 Aug 2018 10:05:15 +0200 Message-Id: <20180810080526.27207-19-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_090619_161120_0A6BCF6A X-CRM114-Status: GOOD ( 20.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We no longer need to register the MTD notifier to read the MAC address as it's now being done in the emac driver. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-da850-evm.c | 28 ------------------------- 1 file changed, 28 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 521a26b5c20d..1df796b67b82 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -137,32 +137,6 @@ static struct spi_board_info da850evm_spi_info[] = { }, }; -#ifdef CONFIG_MTD -static void da850_evm_m25p80_notify_add(struct mtd_info *mtd) -{ - char *mac_addr = davinci_soc_info.emac_pdata->mac_addr; - size_t retlen; - - if (!strcmp(mtd->name, "MAC-Address")) { - mtd_read(mtd, 0, ETH_ALEN, &retlen, mac_addr); - if (retlen == ETH_ALEN) - pr_info("Read MAC addr from SPI Flash: %pM\n", - mac_addr); - } -} - -static struct mtd_notifier da850evm_spi_notifier = { - .add = da850_evm_m25p80_notify_add, -}; - -static void da850_evm_setup_mac_addr(void) -{ - register_mtd_user(&da850evm_spi_notifier); -} -#else -static void da850_evm_setup_mac_addr(void) { } -#endif - static struct mtd_partition da850_evm_norflash_partition[] = { { .name = "bootloaders + env", @@ -1470,8 +1444,6 @@ static __init void da850_evm_init(void) if (ret) pr_warn("%s: SATA registration failed: %d\n", __func__, ret); - da850_evm_setup_mac_addr(); - ret = da8xx_register_rproc(); if (ret) pr_warn("%s: dsp/rproc registration failed: %d\n", From patchwork Fri Aug 10 08:05:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 901F2139A for ; Fri, 10 Aug 2018 09:11:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EF6C2B883 for ; Fri, 10 Aug 2018 09:11:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 726492B8CB; Fri, 10 Aug 2018 09:11:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1C9D72B86F for ; Fri, 10 Aug 2018 09:11:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=QTz27SeUDrRXXitmGVMupbhS4OB5EyzbLKQDALs+2bw=; b=EBvNQ6zYHuvUHIknswNX19xqRT a7+9Nl3VChzLnLFhXkb3zdiMUe16d7s5VY0b7FkaY5jmAiIYsLiA33glxNeAipmvdqiIY8IGVogbH 4Qc8sKRNqTFzjQEG0GH1D+XTvbS3uf0Pmb8rmvgEWiuOM2lwQ5uenih5SK3dHDS/n6UQASzeB3Dla C5pIWYm951t1bUtoTV1FvtwA1v35YL4v32P8VbYcIAE94YHD4vU1RJz55HTc7PUySxX2klDT7jzPp I8dpkNwLyUpcAOPPxzW+yxIv79/rj2mF02wQhjnYuAVtj4nsXoGBdMV7D6JB/lu8gmAzYYBW7l0tL hZPXIk8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3Rl-0002xe-MD; Fri, 10 Aug 2018 09:11:01 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3BP-0007pj-UI for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:54:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7hGAs3eonwoCQnALsYwyOyrZG60JWD61CbSNH1Ct6wM=; b=MN1O82WDbUQFjhew55I9AbJWV jbXJeupekT0HT5IS1p92EeN/yjUoDDW9v/no4a0DyX+d0FPwLLZZptBlMvq7wSVl9it6EusmkecBo S4U+1nRiQI7v9R7/BcEzllX13qKCYAv/92mwUPSfMksNy6GiB0wJIsjeT96OxHX+WkNSsqUO0PVoB SFMdRRej8Svl8I+dUlsgeyHofhgAQ1yW3DpW7Vt0fVhIsj9oF6apC1FkadhEAP+W0FSBqtYKg9wik aIMCFzWxJmCNLVlsEgQ90Qj8yHeydCdzs149xYywWGRCczXybcHPULkqEPsyTV1rZwf/RiUgZ+8WA /JArSpQAw==; Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2R4-0007XV-2Y for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:15 +0000 Received: by mail-wr1-x42b.google.com with SMTP id g6-v6so7495178wrp.0 for ; Fri, 10 Aug 2018 01:06:10 -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=7hGAs3eonwoCQnALsYwyOyrZG60JWD61CbSNH1Ct6wM=; b=TW52wLxb6U1S+RUIaPLZ6sLVh1ll5ayu4Tyxowh2V1yuOjo6qbPK8H0aTaBmRKlnFv SrS0jHot3Dwd6t0U6JIwAFAPBdoVjIW3SPmji9a8Z+EJSOIkCSrFS8F/K8Ezh9vI/ctZ +mxkzFJR65rNeIiq7Jt3JG7QLORDmLsbuCCSQsUycS+22h5v7szEm1I+E/GOE+mX7MV1 p7o5JN8tFkOE7r7rfpNe4BR73GiWTKa9GRuBICd8/bOwByErKcAD7r31paEBNHbtkySl DrGTWalChwpg2xfIzRYexE470R+mlhJWo+GinWS31pX0rx5vZMqe4s06IE73hLzu+CQw ii1A== 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=7hGAs3eonwoCQnALsYwyOyrZG60JWD61CbSNH1Ct6wM=; b=gkfJWasxfhZD1a/xX2+8ULYKlLimmCVFjDNBdGNz2KNOWtqRaGzE6nHYVFVkJns56H ayC2mRuD1wbFUMMUGIPKxTlGhkbWoF5OfsV79GBGR8IIhar5kOsMBeLrUFYVfTezimy7 vEHANpySg3Gxne2H4ednlJ3Ai2YZkzmaXbDHPGyE2jeFcwf1RNbbiUpUeYwNAx2p5Srj TXoMf+flsT4/yyvZLzQ9OX4BAoL8ktFH+kLpSmNpksDxJGszSkU59s6zE+nHsC8M7H6G OzLR4DkSac+SaTDVdN/aQsYNZ/fZ+Ig9zN5r9Yos29fL9IY+lr4bFWXV7zRcZGbQg6z4 W1LQ== X-Gm-Message-State: AOUpUlH59377M4Tf2XLHIkiHmu9pMRZeRoGs87tk051Bn6L4i3GGNt70 mtxnjYxUZDix5SO7Fvjhu/0mJA== X-Google-Smtp-Source: AA+uWPzG5KCSYEWGj/jUKsuWmN+eyaYzGxbxySiyML7PJw6E/g88i9QHvKbm+0DWADIM/WiOi2mQOQ== X-Received: by 2002:a5d:41c1:: with SMTP id e1-v6mr3517699wrq.25.1533888368546; Fri, 10 Aug 2018 01:06:08 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:07 -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 Subject: [PATCH v2 19/29] ARM: davinci: mityomapl138: don't read the MAC address from machine code Date: Fri, 10 Aug 2018 10:05:16 +0200 Message-Id: <20180810080526.27207-20-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_040614_151392_BA08BCAA X-CRM114-Status: GOOD ( 16.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski This is now done by the emac driver using a registered nvmem cell. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-mityomapl138.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 48a9bae76e4a..35b2b6068a7a 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c @@ -120,7 +120,6 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context) { int ret; const char *partnum = NULL; - struct davinci_soc_info *soc_info = &davinci_soc_info; if (!IS_BUILTIN(CONFIG_NVMEM)) { pr_warn("Factory Config not available without CONFIG_NVMEM\n"); @@ -146,13 +145,6 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context) goto bad_config; } - pr_info("Found MAC = %pM\n", factory_config.mac); - if (is_valid_ether_addr(factory_config.mac)) - memcpy(soc_info->emac_pdata->mac_addr, - factory_config.mac, ETH_ALEN); - else - pr_warn("Invalid MAC found in factory config block\n"); - partnum = factory_config.partnum; pr_info("Part Number = %s\n", partnum); From patchwork Fri Aug 10 08:05:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 34C6814C0 for ; Fri, 10 Aug 2018 08:22:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2328D2B795 for ; Fri, 10 Aug 2018 08:22:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16C292B7A2; Fri, 10 Aug 2018 08:22:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7B9452B795 for ; Fri, 10 Aug 2018 08:22:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=jTLVxlT+S6/+IYWcVO/v2+34lKUPqU06s4/mHNLNkLw=; b=MHN8I0PUl5FlKOiUnD2aOx59ag 1vhx1HptpikpoS1ipGF+wECNVzGKVxrq0RHc4RMT6h9KetCsTpTRYq4ppoYoyltqKziT/G1yGjsOt p6KY41PMPik84Y3J2+LCyIQ6qJQyZWf4UlrFRhotGb4mwsXxrHQqqmYkE1BksQ0M0MWAh1JNXzFLT KgOS5N5xVndB2vOjtsFuBEP6xCmR+7H75+RjNVGgwnifDcngjUPd74EFZWI7Q1dudYB6ar7t+sOYo ovTinSwGZj/J8CS4GSrCqzceqvr1c5z4KhnmV8uoUy0IMsIAI2VUUODQrnYjJ3LVbH1w5VDlNMBAW 1uTlzxMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2gv-000867-Gz; Fri, 10 Aug 2018 08:22:37 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2gc-0007aF-GR for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:22:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HPXa1j+zFmSDAVh2jGMcP3wD/npPGnLx7r1kNiFN+9Y=; b=wTwxAuCAmwy9WKp59ZOKo5M0a ygTBRYo/AlBvYJu4uyy0L2T7+qh6pfUuZ9OhRbZjCWXapc1M90Q+hN1F5l5QLltrulOF4QDLmhivC u9mDHuxA0z7XPNq3mTpX8IjkjvmqKfeFk7kyp/23Q7gW5/fXMYhUQc26R5ZcJqRNGOLFwnTH+ZXby zUaPlGqnBjFBbYi2XHtBzNSvVdIjea/XFWOuMAv9AIbhODS/AfjBbqu8hX77LIGM5LNehWlXLTE0+ tZXCFHqAhyZh2NAi1dC3B/hBJ0KGiiaxAZQ91vm8KkIv/TIpg1FakaJvwM7cryfkkKFTjKh8GW1Ec GLtmolzoQ==; Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2RB-0000Zz-F2 for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:26 +0000 Received: by mail-wm0-x242.google.com with SMTP id w24-v6so938153wmc.1 for ; Fri, 10 Aug 2018 01:06:11 -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=HPXa1j+zFmSDAVh2jGMcP3wD/npPGnLx7r1kNiFN+9Y=; b=O+OECH4nC1bg5wtlSFpOGT9gHilp0o7Nlfityg//si0KFiuNYA0OwATePITmZCM4PC blWQAKqRmehTaQnZkumesFl/qcoEjM5nFW8kFursazipXQlAfP02T8lsI4ZaA66KMY+G pWqfiU7os8y3GFa9Xm2lZocwn8SouFVV7qtnRn24oyISNd6zXxMBsmBy0OYwAJqFkJ1e WB3tB1JokligLEXKuSYyskmLiZE+0pE0xX/Z3DUBkmrPUtFyCeKQK5/13Rsqs7sAwB4c 99bV+y+gVHxXXS94l8dx9yFX+ItRGrMV+YHv60Mf2T+df+l5vi2XQd+A3VZTsLLz00Cc 9/5A== 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=HPXa1j+zFmSDAVh2jGMcP3wD/npPGnLx7r1kNiFN+9Y=; b=XA7MOAm7LZt9UPjGR4CuufQMq0Vgox9QcoXueXlgjWc0JbjgfGCPaSzjTb+vwRz1eR VhP2U7JEW+qEjYFLchPvcwyqQ0/GPTNlq+/4ahPfydEFnbLvFlDAGL/Tusg76Jl/al4/ 6LJrsXczTkIqQYsOX1vSwvrK4r88n5MQ8NjVQvkihs64cFepqPfvbJ5edLygXzxUqDOJ p3YQU6YpNrnxy5x9ef22vyVYUZ00JFRW2YYdc/rW0PhmL/r6P3bT5n/SkiKDfS800n8t f+weQTJyYqDMnPlCkbTCH4g14hvvjfV1khiGt3evOJAq2doA5BRPxOSC0y0w15m+82ui QunA== X-Gm-Message-State: AOUpUlGFcBVOZ2yZ3+akf7jLKL8SYaBBZW8FIakAj1g/dTg4ifQW1IqY SE4Xy3XLz0mu38Bs2EIciAQZfg== X-Google-Smtp-Source: AA+uWPzbqN+AvO/5M/oQG93TVlVH8teA2PAB2BfHk7uXDyI0S3yEV3Zr3HSzXM3lV5M/EDJiJplu7Q== X-Received: by 2002:a1c:8b0d:: with SMTP id n13-v6mr730702wmd.46.1533888370458; Fri, 10 Aug 2018 01:06:10 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:09 -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 Subject: [PATCH v2 20/29] ARM: davinci: dm365-evm: use device properties for at24 eeprom Date: Fri, 10 Aug 2018 10:05:17 +0200 Message-Id: <20180810080526.27207-21-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_090621_496451_6018BD7E X-CRM114-Status: GOOD ( 20.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We want to work towards phasing out the at24_platform_data structure. There are few users and its contents can be represented using generic device properties. Using device properties only will allow us to significantly simplify the at24 configuration code. Remove the at24_platform_data structure and replace it with an array of property entries. Drop the byte_len/size property, as the model name already implies the EEPROM's size. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- arch/arm/mach-davinci/board-dm365-evm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index cf3f2e611228..2447e08dd68d 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -179,18 +179,15 @@ static struct nvmem_cell_lookup dm365evm_mac_address_cell = { .nvmem_name = "1-00500", }; -static struct at24_platform_data eeprom_info = { - .byte_len = (256*1024) / 8, - .page_size = 64, - .flags = AT24_FLAG_ADDR16, - .setup = davinci_get_mac_addr, - .context = (void *)0x7f00, +static const struct property_entry eeprom_properties[] = { + PROPERTY_ENTRY_U32("pagesize", 64), + { } }; static struct i2c_board_info i2c_info[] = { { I2C_BOARD_INFO("24c256", 0x50), - .platform_data = &eeprom_info, + .properties = eeprom_properties, }, { I2C_BOARD_INFO("tlv320aic3x", 0x18), From patchwork Fri Aug 10 08:05:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562431 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6263A157B for ; Fri, 10 Aug 2018 08:13:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F9532842E for ; Fri, 10 Aug 2018 08:13:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4200A28475; Fri, 10 Aug 2018 08:13:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E88C12842E for ; Fri, 10 Aug 2018 08:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=qyppo/JxtTAIq4fxLUMFOXuS4PAzLjMIynJ8fcbrqhc=; b=tXZ/LY3T3KrfRsyeTWNyIOB5eg uAuq/E/eIG16gJBHsJnV9I7zdchZaQ/lbcujIiyPyT1NlcLRcMexh5mhv0FqUoH1JAgPzww60hDGc jpEIWJV6J6M2PMA5Isw+cHAMTefKrfQ4j8UdtVhPGianCGUEsTseJscrIn17v67Z2Bfrpn7JkFWv1 IOeCLCc3ZBSplcjagKwMt3kymovwMYhZemyGqtm/LR8EYdxWE5pyaFXqcUA5KRNjUexvrMvaNpHzZ CRGveMjZ3wE9IErU2W7+XEdYPolYfmQBj082BELvTuaB4+D88NFKBw7G6L5y8Vg9pf4vaM6iazOVt iauVv8mQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Xk-0002Tl-0f; Fri, 10 Aug 2018 08:13:08 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Xh-0002SC-Ov for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:13:07 +0000 Received: by mail-wr1-x441.google.com with SMTP id h9-v6so7506438wro.3 for ; Fri, 10 Aug 2018 01:12:55 -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=Jx2k6guhhdaGBfaejTqdRGnDImbwefudlSdHFEKHg9Q=; b=KphW5zAK8TCeq5wOZ4AZmk1aBXf+mnTJA/OPbH2dTCGSe6mBs9y494lmnUisszbBtk mEIP6Oh7f/vXblqr/icAdT4N57BN2hM9Osa1BebjVyMl6YoBqpEmWWRXaffx5lTcf7qm x+ejkZtVGmYGEoEkKdzOham31doDtfvsK7yBm/wt1G/Bi+LuWRmItgL2ayYGU2nMfo7S REVQ0jYgIkUnE4AlxQS063AlZWc8TebNr/8enBYgdV+8QvTsJECujvCH8oLIzohkNJSN MALw50lmGg+HqjBdPK3d3X9KtO4rBM7ryigf10Wa5QXMSspbXtEuVTibxCgvgc2m6PpY XnwQ== 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=Jx2k6guhhdaGBfaejTqdRGnDImbwefudlSdHFEKHg9Q=; b=hhoU27a1dZ1Zl77FBY4rQGGJCDkYxg0Sq+vgUpZ5WMaVrJvHADaDwc4ohhQSu4xCoU 10kERJuyexfySlQ+N22WPsHRU73zv5TS52btPMK+ohDJ5wKecykrd44oHdo+VG+td1GY L25v20mahvrFzlq5f/t9cYMLEGoqp0+i2jD+QvnJ/0Ot5Hrs7/MQAS/6jZCZABkC8pQ7 pf46CpnpJDkNdQ4bOMzM5XPRTZDSkChJpqPZ6yrgjw1Ha3avClK1TV7/8Wxkj3OeOxCw 6nz71Iy8JgBCEF6U5AR5668A+VVetDexRC36IDoublp1U279fmIP97P3itrdyiGCCoFh WGog== X-Gm-Message-State: AOUpUlHdcCLQ0SOpDEQPoC+/zKSnYi//TkMoz79kHuWlo+QDiV+grFqj KGxrWwr2x6TXUJAAaJQLeIU/Xg== X-Google-Smtp-Source: AA+uWPyd3qLqj8KFS2qjHvKvh+iViTk2XZdmNcbGuf5/UXQI16q/rPtmENImNbQgmng11ZCylUTNSQ== X-Received: by 2002:a5d:574d:: with SMTP id q13-v6mr3396228wrw.24.1533888372261; Fri, 10 Aug 2018 01:06:12 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:11 -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 Subject: [PATCH v2 21/29] ARM: davinci: da830-evm: use device properties for at24 eeprom Date: Fri, 10 Aug 2018 10:05:18 +0200 Message-Id: <20180810080526.27207-22-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_011305_813080_EFF8B173 X-CRM114-Status: GOOD ( 19.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We want to work towards phasing out the at24_platform_data structure. There are few users and its contents can be represented using generic device properties. Using device properties only will allow us to significantly simplify the at24 configuration code. Remove the at24_platform_data structure and replace it with an array of property entries. Drop the byte_len/size property, as the model name already implies the EEPROM's size. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- arch/arm/mach-davinci/board-da830-evm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 9a055ebba081..fcfd1565bfdc 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -419,12 +419,9 @@ static struct nvmem_cell_lookup da830_evm_mac_address_cell = { .nvmem_name = "1-00500", }; -static struct at24_platform_data da830_evm_i2c_eeprom_info = { - .byte_len = SZ_256K / 8, - .page_size = 64, - .flags = AT24_FLAG_ADDR16, - .setup = davinci_get_mac_addr, - .context = (void *)0x7f00, +static const struct property_entry da830_evm_i2c_eeprom_properties[] = { + PROPERTY_ENTRY_U32("pagesize", 64), + { } }; static int __init da830_evm_ui_expander_setup(struct i2c_client *client, @@ -458,7 +455,7 @@ static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = { static struct i2c_board_info __initdata da830_evm_i2c_devices[] = { { I2C_BOARD_INFO("24c256", 0x50), - .platform_data = &da830_evm_i2c_eeprom_info, + .properties = da830_evm_i2c_eeprom_properties, }, { I2C_BOARD_INFO("tlv320aic3x", 0x18), From patchwork Fri Aug 10 08:05:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562433 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77E11157B for ; Fri, 10 Aug 2018 08:13:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 641602B71B for ; Fri, 10 Aug 2018 08:13:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 510A52B70B; Fri, 10 Aug 2018 08:13:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DC08E2B70B for ; Fri, 10 Aug 2018 08:13:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=AHfTBIRXWQIg0VQRsZ/PZFY8ttRekgY1CkFN5gEgths=; b=OPgRSs8RetXbeWVpzc9VJuvM2u poXIO+FYemtGvnYd3jc451VXIkYBtz4yJBmGGA7iv5+hMSZvo5/de2SxqkVBNKQ4VDa/Z3daCQWUg oQ7zQBDVCUjkar+0GjIxXW5igJeSYqtykp2qbIvHNUWEg9Qyh0Eo45Ee/YrlpPP3JfAoQ/zltxB/s X2y6PfDdiC+sjNsx69jDxwFg924KfbZhzRUhQsKLVLHij0r0xIdXbAsiPPXUPVhtTTC3d1uiVRLF/ VBtCs7zwxTRhgScj7/8MQK5LpspJhpOSFCzMvKPh8twVxcTaeUysseQZNb8YnFTSt+MMEHS1AJpaC opBi/Slg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Xw-0002if-Bi; Fri, 10 Aug 2018 08:13:20 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Xr-0002TJ-Oz for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:13:17 +0000 Received: by mail-wm0-x243.google.com with SMTP id s12-v6so959483wmc.0 for ; Fri, 10 Aug 2018 01:13:05 -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=2XJsVm0WuqF5PCKtq4F+QgEyPMFdIFrJ0P6MxMphb2w=; b=1hQ9fY4fRn50E/NBrltIjcbGRbvpoX35hybYGJ/WjXssEj+a5sBJgUoiopfctEacsD ou7ZH3w9iE+ZWFNgBgk8KNWzSPK6J8gxHyijHjDL95XTk3SBIcffkszH25aoGUY7WGky eKcviDDKKDRVkyw51s5Mw9xvfVyhjXEyhpk/wFqgdetHBFjqtnrln+UgzEzrtnyZ59lD /LWzvHPwuhrnsSsgvZe/ZTMWzdr+RpRytfXqdwV5oByARnfG1dFarrQN7JTQg/24vHiC 8+foTnaQGSWuZ+28/lLNC6CLfxRUF6IUA1GeIpGOj4eKJMsXMfoVemYZb/VNaqjgJPui J0yA== 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=2XJsVm0WuqF5PCKtq4F+QgEyPMFdIFrJ0P6MxMphb2w=; b=LnHonhQFo2pYJ+Kpkvxp/j7e08jidZfq55jVXWVJAwRledvGVA7coHh43T291fnWBU 9i0G2nG3GIaNA/1IVBMAhg28CIU0ax52tAGCVGwVmOhCsOe+0XObW4WCSyJO4+QoOhZ9 qM4raTUoChSvssyBE73OlECpU7SvSNk7QmRo+m/G0rhKpooF6rRfIPsxztPFkJHBcmuZ laBWv26sNZfcHHCq5ofSUT986E2PIBOnGxmWjnCdb/u9wV0YPTbB3jyn9rqgWaXdMja5 YJxvnFbcl/Jdv2yCAGLonPBKtUgyxFw+/YKawkGtBANy9jpycUwS2Tm63/yIea8qFRxC fMUQ== X-Gm-Message-State: AOUpUlGHJWZI09Y2St6MCP0CzoEpgZ/JpJqkicy5JLYVpJABVL+h/NeM +uijeQkrGw9f0iZm8TPU+4XjSA== X-Google-Smtp-Source: AA+uWPxS/bjMnRwWRr6p7SEdXPfa/06EnMWo0ltWQqQMo2eRQ0yUGK+UCc7XqlSXcy4Fi4s1gaVAHA== X-Received: by 2002:a1c:af53:: with SMTP id y80-v6mr746897wme.55.1533888374272; Fri, 10 Aug 2018 01:06:14 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:13 -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 Subject: [PATCH v2 22/29] ARM: davinci: dm644x-evm: use device properties for at24 eeprom Date: Fri, 10 Aug 2018 10:05:19 +0200 Message-Id: <20180810080526.27207-23-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_011315_977000_7F188535 X-CRM114-Status: GOOD ( 19.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We want to work towards phasing out the at24_platform_data structure. There are few users and its contents can be represented using generic device properties. Using device properties only will allow us to significantly simplify the at24 configuration code. Remove the at24_platform_data structure and replace it with an array of property entries. Drop the byte_len/size property, as the model name already implies the EEPROM's size. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- arch/arm/mach-davinci/board-dm644x-evm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 829fa1c8d0b4..954296d23297 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -16,8 +16,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -486,12 +486,9 @@ static struct nvmem_cell_lookup dm6446evm_mac_address_cell = { .nvmem_name = "1-00500", }; -static struct at24_platform_data eeprom_info = { - .byte_len = (256*1024) / 8, - .page_size = 64, - .flags = AT24_FLAG_ADDR16, - .setup = davinci_get_mac_addr, - .context = (void *)0x7f00, +static const struct property_entry eeprom_properties[] = { + PROPERTY_ENTRY_U32("pagesize", 64), + { } }; /* @@ -601,7 +598,7 @@ static struct i2c_board_info __initdata i2c_info[] = { }, { I2C_BOARD_INFO("24c256", 0x50), - .platform_data = &eeprom_info, + .properties = eeprom_properties, }, { I2C_BOARD_INFO("tlv320aic33", 0x1b), From patchwork Fri Aug 10 08:05:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562483 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C107C13BB for ; Fri, 10 Aug 2018 08:55:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC1FD2B838 for ; Fri, 10 Aug 2018 08:55:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D2632B862; Fri, 10 Aug 2018 08:55:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4103D2B838 for ; Fri, 10 Aug 2018 08:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=RQER8YfMzzKAaCLiY9ZzJd+8dinTL0+7ZRfNb/sEI1E=; b=VfEl0ejvqGvzacNqCaZzh9gbQo 4Zm7US/W1/quKkX3MziCrVe7ydObMJ58mePv0A0+8YpuBmiwynRRZmUz0cnJpZR1yr7bIh2VeLI6r Qb6o9yG5gn2MgKoSYpWWeAGROV04RdI2uAFyv0qSdPhCMBgevap4SiZYo1M7Ld2VQL1Cfi4S24e/h PMiu3Q7nzzC1nq4xYWADAEuQz7tAn3ILQ7QbaHoC16LQxNKs5AZdX0OBBupqdVRejs3cpAQMEPsJS A5eGS7GceA4/EdJ9c3HOUe7KPuv/AeRiwomO55KD4bod5vLlrJUjHv3eAaY9DJ7vXRmwm4QN2i+BR Kn2d/+Yg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3CS-0001qz-RJ; Fri, 10 Aug 2018 08:55:12 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3B5-0007pj-8s for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:53:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lM+xHiYLR4UYi5F2NXWnALiFOQcF0j1BgcM3dz4IWYQ=; b=vh4S1/g/EuZcZHBq4CuRaWct1 AGyv1zceZNEMkz52Yt2S2mS3z+gBmNAb18E1Mr+rYqWu4arpUWPcOkESXZ2t/n+q84+0pdtF1CaBL FfebuI2u4Oqm/ugFCahJDrTtNHsNrd0zgYTKTnKSAHxLAMlWQGLkjB9u4uARcZRuBPaz+1/jrGun4 J3q/kB/KnJluYg4hfAAhiMEXJ4gxOm4Nk6TL/VPVC9eQ0HxEzv0sB57Aoyu2+Az8vVzNd++1eYPY0 1iYjUnfmoTQAogdNshUSDN1PDwdSXhQFs1p/6s4ZT4dW0kxoWshd5XVOhzjyhy4hBa1XX7K6yhHHL Ir9UFmHYQ==; Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2RI-0007bT-OY for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:29 +0000 Received: by mail-wm0-x241.google.com with SMTP id y9-v6so933170wma.5 for ; Fri, 10 Aug 2018 01:06:18 -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=lM+xHiYLR4UYi5F2NXWnALiFOQcF0j1BgcM3dz4IWYQ=; b=vHThuMMI0Qcou5hHH/sIA6W37T74NlFtZcOLijBnjUCv/af63PSw94DC2iZbHRck+a OKAxCZ0VIUJQJZTaAhkMHTOyCng95OSorHUwVQe5VwTFdpTJfu0q2cYi3CLuWh+DajIz tEpyAChEzphKPqWdHoIg4BLHZ/xcHaHwmoTyZnfQ3qgB/m5x6Dw4CbgsqFEi0aHODZZZ IOUZJT/zzB0Ai5G9/ZgEiiweyo9/ZNh5Xut0MdO5TjJe85Kel9GxjUw5JnWOHjqo/Jzb S2gFxEjFA9c0JKUVH4trc2MLNBXxMl87mpa46sutK0Ji5BuEOzWvbuI9yfObUvKaewk9 Qf9A== 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=lM+xHiYLR4UYi5F2NXWnALiFOQcF0j1BgcM3dz4IWYQ=; b=XoFUbNMz0ROOA6ZRL4wQfgfIUD2YF6Cd+T2bMtt20yHB0VETNKz0fu9CxHqcdqJbVh kv+s5isXny6aNehE14tqfQ1yDfCArV0+L3yzrWSLQsYKL1h9upV8wgnW1iiUYT8rbFsY cpNFYXSCfj0lhP6FG0x1mpCD/4bLq0bEZZeT8KsFEq42/jRYU3R3/BMakSYB6q0beVFp COwBEv2MbGzyp4lTs1VBXWhkbcO+qs32AUrvlUqGRngEuboRQmv1axx0ladkZJSAPNZI hv7lY/dBzQJhxQ2ibL9+BcWMuka7iQi33rGjL0lDRD/YVML+tRFantJy0pPTFoKxixsX usVQ== X-Gm-Message-State: AOUpUlHUd8V/EeaqZoUoxCudCE/dUv48LZUZRUlpHqQOwRiyubc8aZXv 7ZiDEUusSfr2o8oPvNqoNTjULA== X-Google-Smtp-Source: AA+uWPyZ6dhQY5ntZh4vggV3EizWJfYtC6h8L98pOBZkCq81N6X+VzofNeO5r8hSzMubAr6CF7D/IQ== X-Received: by 2002:a1c:a691:: with SMTP id p139-v6mr781536wme.42.1533888376791; Fri, 10 Aug 2018 01:06:16 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:16 -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 Subject: [PATCH v2 23/29] ARM: davinci: dm646x-evm: use device properties for at24 eeprom Date: Fri, 10 Aug 2018 10:05:20 +0200 Message-Id: <20180810080526.27207-24-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_040628_847066_89ED119B X-CRM114-Status: GOOD ( 19.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We want to work towards phasing out the at24_platform_data structure. There are few users and its contents can be represented using generic device properties. Using device properties only will allow us to significantly simplify the at24 configuration code. Remove the at24_platform_data structure and replace it with an array of property entries. Drop the byte_len/size property, as the model name already implies the EEPROM's size. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- arch/arm/mach-davinci/board-dm646x-evm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 943ab0ca6db8..04d293096962 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -320,12 +320,9 @@ static struct nvmem_cell_lookup dm646x_evm_mac_address_cell = { .nvmem_name = "1-00500", }; -static struct at24_platform_data eeprom_info = { - .byte_len = (256*1024) / 8, - .page_size = 64, - .flags = AT24_FLAG_ADDR16, - .setup = davinci_get_mac_addr, - .context = (void *)0x7f00, +static const struct property_entry eeprom_properties[] = { + PROPERTY_ENTRY_U32("pagesize", 64), + { } }; #endif @@ -396,7 +393,7 @@ static void evm_init_cpld(void) static struct i2c_board_info __initdata i2c_info[] = { { I2C_BOARD_INFO("24c256", 0x50), - .platform_data = &eeprom_info, + .properties = eeprom_properties, }, { I2C_BOARD_INFO("pcf8574a", 0x38), From patchwork Fri Aug 10 08:05:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 18C691057 for ; Fri, 10 Aug 2018 08:53:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59E8828600 for ; Fri, 10 Aug 2018 08:53:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C8B22861D; Fri, 10 Aug 2018 08:53:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F35C128600 for ; Fri, 10 Aug 2018 08:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=xr98pAGWTYr5+hR2mw0x0I+qJXLQGAf3nMV9XSwDArY=; b=t43cepeAHgh3SBd441EpWuVaeo eeCABttaowEmU3Bj9AhhaT2sWiyJnOnuaZxB8po73CoDJ8/776CGg/bXyugXfwS/TD+0O6c+vy7nt 3B5G8vZlTbvDQ95W+VGgv2osm9qsF+KwOvLhyiyI3Ar0NZrOUyQ4xLgv/n21Ys2RxRURp+SQPSM6G peD/1cCTYStD6H5eebX5bSQ9HMgrprWy3LVNyQhZJSe3+qJeQ9u7oZ6r8lZFCZrFRNSmcQ5jqtEk5 jxb36pYWea0WA8+D7IJb2dipymYDc8nXSuGWVmm8hdci+lo6Y5zACxN29kw3sg65vcRlWgokwmoVB ytb2eW3Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3AW-0007pu-D7; Fri, 10 Aug 2018 08:53:12 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3AU-0007pj-Js for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:53:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3zmWRBLVjC00ebZcBXbf19VncOAWdFwL8jWPHWZ5uxI=; b=XB0xNnhMORJmgmlGfOUMlzjLZ wNvH31rIDnNl2Lwuwt+UbFsdhS2POGpYE63e8veUQQ8wBXpbVNmlo9/1AESj5cjJC/hgu+awYo4IB zu549ZibGggiL1m84J8o/yA+S4FBSJzEjww+e7+nuuWRbnybSkhHFfRtlhKT48DD/sYddZfdXSY3E 43sVrzr5CKLngqkD0sQQ1HX53l7Jgzm4B9dFAq7DjEgjAWhn58C6Y1HMBt9Qb/UWg/+iA+wy9vOxn Ohv5vuEfbL8zR/lKZwrx1LwxTP/oMcVwTSkdP2c60aiuwyQsaVP9wv7yHX4o9c6wgmX6qPElXrRFb NZJBT1kiA==; Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2RK-0007c8-99 for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:31 +0000 Received: by mail-wm0-x243.google.com with SMTP id f21-v6so918902wmc.5 for ; Fri, 10 Aug 2018 01:06:20 -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=3zmWRBLVjC00ebZcBXbf19VncOAWdFwL8jWPHWZ5uxI=; b=U3PL+3n3uXolcLkxhCewaU9ykJwXzrjjMK1woc6BFMPgeiMDMP9FswEHoYiPpIN8C3 fJdZKIwV/NJDvcFEboCLIkBNowV9LPTavvVxl/x/E4yc0393bIdZQqdT7swf+CWeaB+m yY6ZemJKyrKm6H01JyEABY3FgzxOf7DjReOFi4FurkDOPJovVciM60fH+2T00EKokoeE NV2PkaKP0Rw9KkhqdjvSyZEWpiZIBayjgbPpXtlMsvBv01o3DK8CRuNbxww56c5cZaIH 2iJPNR2r/o25vqnG4qK3UaQBD2e7xcs62G6Qb+QIrGUXqNsV2DmXtNNneufxF5bUbhbA zXnw== 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=3zmWRBLVjC00ebZcBXbf19VncOAWdFwL8jWPHWZ5uxI=; b=nIt133nbnh0F2Td0peQruZCq2uAwrja9y3feTRBfxINmVGjWxST3k8H9yFR2bRIOm+ qIHBMASclxLAgrnI3Ip1y1bRx0B1JFb7tvaQafL9v49gB8ri7jfFOg7m5sbwiBWR1SsM Z3JwF3YY1CJk34slUedoWowE2KNmUTczG1M4WuYSAVOmTjOBocEMGTwlfVWtK7dbedga RUTrBaqSwTSVdwkUCVw7dyznF9vDbmvO0J7pDwOwny1m8fKXBSTJGxcHpOJloIu25s9a 66mxT8lPhWcMEjYAoS590BMmkVQR7acAuTm9itE8XR7zCMseHjA/5kgO6nLVv4pj4Z2n aadg== X-Gm-Message-State: AOUpUlFC2A9mYLOgj1VK1+16xy7uConZFNrRezJAAu6c2b1oukx+Y8yL T/0NU8ebeawR4d8ewj+zFeOz0Q== X-Google-Smtp-Source: AA+uWPxi9geU7Rdg+6i3cWwgv6KbIFPXpfcpG1RrXVcM2DpCUAXrnYX/ZIeWs+BU9/iygdBJqYQJTA== X-Received: by 2002:a1c:1188:: with SMTP id 130-v6mr768950wmr.138.1533888378597; Fri, 10 Aug 2018 01:06:18 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:17 -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 Subject: [PATCH v2 24/29] ARM: davinci: sffsdr: fix the at24 eeprom device name Date: Fri, 10 Aug 2018 10:05:21 +0200 Message-Id: <20180810080526.27207-25-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_040630_396767_A2EB5294 X-CRM114-Status: GOOD ( 18.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski The currently used 24lc64 i2c device name doesn't match against any of the devices supported by the at24 driver. Change it to the closest compatible chip. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-sffsdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c index e7c1728b0833..f6a4d094cbc3 100644 --- a/arch/arm/mach-davinci/board-sffsdr.c +++ b/arch/arm/mach-davinci/board-sffsdr.c @@ -100,7 +100,7 @@ static struct at24_platform_data eeprom_info = { static struct i2c_board_info __initdata i2c_info[] = { { - I2C_BOARD_INFO("24lc64", 0x50), + I2C_BOARD_INFO("24c64", 0x50), .platform_data = &eeprom_info, }, /* Other I2C devices: From patchwork Fri Aug 10 08:05:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C318813BB for ; Fri, 10 Aug 2018 08:55:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B05752B838 for ; Fri, 10 Aug 2018 08:55:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1D012B862; Fri, 10 Aug 2018 08:55:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 47C472B838 for ; Fri, 10 Aug 2018 08:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=fwQfuqj5lcdWKRMblgysGUpLOnDvvRqxDKGh1V2f/E4=; b=nIhXYsZWSGr/y+iW7o1j+lGEPQ Tvc5aP5iOAineK9XI3RrzIrNDyKVhaURXX8/l7+bq4vQudwuHdB/bVoWhHf61BewXun/NNVwWo4L+ 7EDZL1HnUj6tCVyxn74O6s2V1pWt95MyWKCLmVn9D8gWIND6VkIc/EVFn0ilG66esGwesz9Gd8RS2 CjDvG4/kTe/d2xRT3PVfFurm29in/NH2dyIxfSeIdDJKMijy9XXqvDxqYFFYIUwqYS/ibPRXQpezY fRus0KqGh7CNjxjfCuHDUMGEAg7H0GAdHrmuBT4iT6flD+3MSlXdxTTvbTj5Lzv4Z6EmbE6CHK5uF OGbdY+mQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3CB-0001RU-I2; Fri, 10 Aug 2018 08:54:55 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3Az-0007pj-1w for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:53:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+IZEKVYmKeDxsrYMT6IImwtkDFAn5lkIQ+xlbddXw+s=; b=fOkoqhcA6FYzvZjSF565H3bhh e+Bt6dudGUfqhECzKUP/Dd4ok/jjnPHxwp2ivMWt61Jw1vyG7fkUYh6Dwn28SU8jp4rM2m5g9tuOd M0a2kjs5tr/wm+rsJDqXseLoV6AE3ArLKxMflfN2fEdLxFnnvr6SwBot+2/Kzku+oso3FqnwuveGH sSxHY5qDlJNi4pR4ZZPN3zJ0q3aZs4snWCs1X6dgkguMbEC82KrI1+IWkX8E+XtrmEMg6CQzcqmqj sIqPFCHpZ1fk9znhkSpZmjhkVP/90olcvcskcIQr3qAFcjBhI5NFIMyw95O8NMhvw1GBbK22TnfhP EcPNOU6cA==; Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2RM-0007cF-9A for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:33 +0000 Received: by mail-wm0-x242.google.com with SMTP id t25-v6so933595wmi.3 for ; Fri, 10 Aug 2018 01:06:22 -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=+IZEKVYmKeDxsrYMT6IImwtkDFAn5lkIQ+xlbddXw+s=; b=WGuGo0xb5j0hcr3045clvo0egQZTJcQ1zPsTs1L7DK+iDqpEvZD5y5dM7hpaMrgSYT nQifoecUNQNdPH8vP5Q+a0o+SxAWK6j0wtRzKJLUkCgUDw+z99LvN+nfilIL0Y73cbW4 Yw95c8IIHAMejR6WEJz5kl8AGpeQTaPFddp8+WSNNSHmd8+7iiV7vu8kHzweWnBdK0pa npIW7/6z8YPPgpDOk7P+SwCUNbMpFyKrOBtU8KTU8S9kqPS+2/ffc6pvGJPvezusmGcN xs+ykCtoP9UzWRxNNQzH1rX9ejMRs/ZAac+BZ7PjEWL7+6/7M4XPnBiJOsccxp5zNu9V krtg== 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=+IZEKVYmKeDxsrYMT6IImwtkDFAn5lkIQ+xlbddXw+s=; b=T2o+FaoOfc8QXBFk0JShs8vi271XjrOLVTc8Qcit3MfYOr9isrHi+5TKKdNxDydben aPBUWvIUqqW4Aj5f7tvoV1BCFg9siU9JqkCR+IKnRuP3oynO3AOeT4th8lcakLLkBgqq X0njuT90IdOAeqEnuPJaXzeVvrPFzdisxamNur1iUbC2d79NFfGAFS1cXwxcl8WqdF59 ZC28MntGDPl8/Rv30Qq7Iu6w/xcfZ2q7H+S66V/jZ7GpbCnriijCg8WdfcD26+ByTum+ lucYvcCtWz2o7h6zijBztKQEQt4RwktBDCmIyADN36FIMlDaL3/IzJIxoTdakahEppv6 lHgA== X-Gm-Message-State: AOUpUlG9cSur5anD4CJuJLj1fIMFb0+IEmF/dJGv97+hpEItkX/a0xTW SVRJ+WdM1KSDrRxBEL0Ct4A9mA== X-Google-Smtp-Source: AA+uWPzatBpR01HvOEq7A9iq/907Kck6yZBBHnMHyW48A/RXNxv2c1WFJolqckPgk75RwolNJg3KPw== X-Received: by 2002:a1c:9e89:: with SMTP id h131-v6mr752656wme.13.1533888380637; Fri, 10 Aug 2018 01:06:20 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:20 -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 Subject: [PATCH v2 25/29] ARM: davinci: sffsdr: use device properties for at24 eeprom Date: Fri, 10 Aug 2018 10:05:22 +0200 Message-Id: <20180810080526.27207-26-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_040632_458450_9F7DEB29 X-CRM114-Status: GOOD ( 19.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We want to work towards phasing out the at24_platform_data structure. There are few users and its contents can be represented using generic device properties. Using device properties only will allow us to significantly simplify the at24 configuration code. Remove the at24_platform_data structure and replace it with an array of property entries. Drop the byte_len/size property, as the model name already implies the EEPROM's size. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- arch/arm/mach-davinci/board-sffsdr.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c index f6a4d094cbc3..4f3bc78e8154 100644 --- a/arch/arm/mach-davinci/board-sffsdr.c +++ b/arch/arm/mach-davinci/board-sffsdr.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -92,16 +92,15 @@ static struct platform_device davinci_sffsdr_nandflash_device = { .resource = davinci_sffsdr_nandflash_resource, }; -static struct at24_platform_data eeprom_info = { - .byte_len = (64*1024) / 8, - .page_size = 32, - .flags = AT24_FLAG_ADDR16, +static const struct property_entry eeprom_properties[] = { + PROPERTY_ENTRY_U32("pagesize", 32), + { } }; static struct i2c_board_info __initdata i2c_info[] = { { I2C_BOARD_INFO("24c64", 0x50), - .platform_data = &eeprom_info, + .properties = eeprom_properties, }, /* Other I2C devices: * MSP430, addr 0x23 (not used) From patchwork Fri Aug 10 08:05:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C370913BB for ; Fri, 10 Aug 2018 08:54:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B093A2B838 for ; Fri, 10 Aug 2018 08:54:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A35DB2B879; Fri, 10 Aug 2018 08:54:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 445D92B838 for ; Fri, 10 Aug 2018 08:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=vOudFbqvLCLvoxEZyKqJTYEmPt8FS30su+SWUyqLBKI=; b=fFI2czmbadjlTpKS0bik4LhhWP OdUIZmz9tUxWebYqXPB4ip8mE5BjCW1S79RaY8jwEyQJVuXweBCsqkoz0VbQorHBpPmtaWrpuFg9e bmLCjex/XBSS0J5jn9ws9e+NWLk/XH1yLbx9SHwddM3j88DNERiw4yNlchWWsyODE/US25BNBxz04 50OKUK5iWRWCfrEUD/Cc+/ONWIUDRYRrE4uKSEutderYGPf0ZPyMNegHvrArThENZjm6mb0S2jROr +zTBO0PfhXvtMYN0oiQIHr8lcpJTUgyxtdFVzL4y1btQUmWblwuf/CuDonJRnSM+xXvJdV/uf3yfR fGQ9zo0A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3BM-0000ST-Ks; Fri, 10 Aug 2018 08:54:04 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3Ak-0007pj-LR for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:53:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=M7UsCvqnFt3W2bHK6DWe4k8iaOUKf7rLaco+g4nZ2Ys=; b=X9KgHf1SFimyfQRQVFbHLpIua IEnOu6HphNxfQwMgRzJK5gC37FurEmzTCYrdjySvrrHUdDmqBG1rCZ3O3NkmCPhCC0qphKj9dVV5/ J8tMmZy1oZbyUYXc/MkHxkStRL5OdsA9SXMA3OUvt18ZNI060SMMvlglmdYJeyZqrhpMEx9lf3qAL SdX8c/UZYxFrHeCUUWZOGioYqL1hbZgmJ4jvjmUH9JiM9ldjuxqixo6bfK5CMvUVHsyQD36j4Vxhu V9vQNs1fE27hmzsYB+iYxSGBnHZPxff1MuIcqE0EVoOz1mWtvNhx3hXAeU8Uy7m9fy7goVhBiIbRE OsX10ZzBQ==; Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2RM-0007cP-JV for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:35 +0000 Received: by mail-wm0-x244.google.com with SMTP id f21-v6so919150wmc.5 for ; Fri, 10 Aug 2018 01:06:24 -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=M7UsCvqnFt3W2bHK6DWe4k8iaOUKf7rLaco+g4nZ2Ys=; b=dwU/32Ufpl4mI0eldG2u4mTgGZt8r/cXN9DbRV3fdxLrv01DOyB9DSOc0vmcXB+b48 RtFFfzOZqFYmTKufvvFhsUgiAc87bbuyKu/HweqtyreLYqkje26H/RnRpbWUr1HmTmnk NpvrCxHiQgAlM7xiWGXdQ4SYk4vZDJaCT0ut7zB1bfAv/8NFxjjisGls4QQbJ++U0Qva /E6FQWvZlQ+CeztxxSNRcQqoyi0qkRDPQpLmdfH7XQzMRwSjisvPuX4QwK0JDInQOZAH CGbv6rE8HtQJU08Uk9HFqdABv1aMRE9w5SKamor7TabNw7LoYjhBVoWZKaaXyFXC6XX1 AcDg== 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=M7UsCvqnFt3W2bHK6DWe4k8iaOUKf7rLaco+g4nZ2Ys=; b=Z9FkG6eW3j1ZHdOA+QrjJAl8i1KowLKtPqSSGzGKL2e0lr2CsgSyPWaffmhWVhGMYm 6omAUQ3Yshf4h4RfF4tcBF/0GJws5847jZXLSOud43ubxJKRIqOLocihOBOPvPiumq1x V09XYr2q3v7uwMgDvSkSVLQEg3rx31StsYAfgrHpUBKwJZLJuenujnzRXgu9J3EdA1+9 aTRRDncPV6Wo4VxphQIVk4OyGbajgkPSIfX6JfCQNQRlN8Rnl4Cpvv7fLY6XRIktUnw2 V8206dObSV9jO+PawNUnhCVoA4qGMvEXhGqToClJLr7TQ7Ew/ES+Y4Gegc54suyHwgtO vxzg== X-Gm-Message-State: AOUpUlE8WLWr93qzpCu4WdlCoPTPufSrzC9JjVlIDPcpr+Xf+WUz5id3 JcZsllBXzqowUdRHJAc/1zFxkg== X-Google-Smtp-Source: AA+uWPw99qS5MdN9yNmmkuybd86vvR6EUgqzbrJPYSG5arNt+kN3G2SU5NsM4vPUB1a6lzY7BthJrw== X-Received: by 2002:a1c:87c9:: with SMTP id j192-v6mr723093wmd.71.1533888382779; Fri, 10 Aug 2018 01:06:22 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:22 -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 Subject: [PATCH v2 26/29] ARM: davinci: remove dead code related to MAC address reading Date: Fri, 10 Aug 2018 10:05:23 +0200 Message-Id: <20180810080526.27207-27-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_040632_732924_F7A9042F X-CRM114-Status: GOOD ( 16.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski There are no more users of davinci_get_mac_addr(). Remove it. Also remove the mac_addr field from the emac platform data struct. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/common.c | 15 --------------- include/linux/davinci_emac.h | 2 -- 2 files changed, 17 deletions(-) diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c index bcb6a7ba84e9..0c6cc354a4aa 100644 --- a/arch/arm/mach-davinci/common.c +++ b/arch/arm/mach-davinci/common.c @@ -28,21 +28,6 @@ EXPORT_SYMBOL(davinci_soc_info); void __iomem *davinci_intc_base; int davinci_intc_type; -void davinci_get_mac_addr(struct nvmem_device *nvmem, void *context) -{ - char *mac_addr = davinci_soc_info.emac_pdata->mac_addr; - off_t offset = (off_t)context; - - if (!IS_BUILTIN(CONFIG_NVMEM)) { - pr_warn("Cannot read MAC addr from EEPROM without CONFIG_NVMEM\n"); - return; - } - - /* Read MAC addr from EEPROM */ - if (nvmem_device_read(nvmem, offset, ETH_ALEN, mac_addr) == ETH_ALEN) - pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr); -} - static int __init davinci_init_id(struct davinci_soc_info *soc_info) { int i; diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h index 05b97144d342..19888b27706d 100644 --- a/include/linux/davinci_emac.h +++ b/include/linux/davinci_emac.h @@ -19,7 +19,6 @@ struct mdio_platform_data { }; struct emac_platform_data { - char mac_addr[ETH_ALEN]; u32 ctrl_reg_offset; u32 ctrl_mod_reg_offset; u32 ctrl_ram_offset; @@ -46,5 +45,4 @@ enum { EMAC_VERSION_2, /* DM646x */ }; -void davinci_get_mac_addr(struct nvmem_device *nvmem, void *context); #endif From patchwork Fri Aug 10 08:05:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562437 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 82CF41390 for ; Fri, 10 Aug 2018 08:22:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 704EE2B795 for ; Fri, 10 Aug 2018 08:22:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63DEF2B7A2; Fri, 10 Aug 2018 08:22:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0A5EC2B795 for ; Fri, 10 Aug 2018 08:22:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=iYvpRhU/KjhVd82pdcq31yODy/DhfZqY1OrJ87R6J8g=; b=eLeRYM8gZ3YqdDFS1cufv9/Cn+ eOeq7BiqrOaFalVVj3wQFO+TCdktx8t5dfavnMPZSFGnO5VBx/BkhxTH1FjNK7JPY2V/UoZbIYAeL EjYJ3Wu33Jq4B8Yz7cCl9EnTYJTjNf8mMB1vd7ntlfLuzsmvjKjBwNt05RBSqlbX4Doq1/km1KznA g6vKaQbxKe75UXv6guSia7Xf3K5G302+Gj2wZtOkdoENJPwxLNshnhv+bNpFNkn/EsnIru6XaOF6g IIWbcC8+Czpn+aI2toI3nHfyZKX89XFQkvbKbaaAlNIRQh4B1ISSM4YR+Pd/1xhTw5zul6joh3GU7 8LSc/XVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2gm-0007uA-Sx; Fri, 10 Aug 2018 08:22:28 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2gb-0007aF-9f for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:22:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jh45iyxzAhZV5lh7mev1xkgD1t3NViMmTz6DgxZZu/M=; b=DgDbfwhn7msyPhUotzQQ9doD/ pEXHTdlLf1/btV1BvyiWL0+gE+8s7JY8+4SohC2Ytg7WENxySbeisGEbqtuwEeUEaZ8jJJmhy1cw/ udjxvp8Hy9ob8vsbcg3k9csEhQa3CwtvLDtHAHPds8Ol/2lSlU+9XHPEVhqTrcAxDStJAk82uzc/7 OhGTEYHnnyt1s4wyiWrh1Qw1kj19n7/M1S8Wnz9YsXDtFtmPb4g4RUmyAiaMcxfQT96FoOkXH2g02 DC2tHJmSEODwvxsOoHACagA+P79qmLwU/IVw+eAsZ12tchacM+/rJFL5FbVVQ32YkhZjoxV+gz4OE FaxzgP6Yg==; Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2RP-0000gJ-I8 for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:37 +0000 Received: by mail-wr1-x444.google.com with SMTP id r16-v6so7438928wrt.11 for ; Fri, 10 Aug 2018 01:06:25 -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=jh45iyxzAhZV5lh7mev1xkgD1t3NViMmTz6DgxZZu/M=; b=bNyrEdedPXI5zGAmm/tROj6OOi3+u09cTRTqviKGU5O3cKOoc+EdIWMSArqZ/R2BD2 jqWPbkJem4BecHC9z6vwqj7wqV1arfFk60D25XPh+NqSnQlyaxVKYn3R3a8KduDXYTMv SdPzch1LepaSQLGiQCg3HWwnhPFxsKOSHN5Y+Rg1P37Ew2L/uZiw9FBI8Cq0AkRLHwzr csG9U5aJINf3VitBZNpKUL6tQTRKSkBjKsoOn4EHIGuVOfx6M8hBhLr86sC9Oj+hpJs+ +PtyWT8uo79iN1UTp64Fag+lXGeqopDTzNMPUn3P/R8/9gNPYB9X+dlCWCsbv71Xwags sdQw== 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=jh45iyxzAhZV5lh7mev1xkgD1t3NViMmTz6DgxZZu/M=; b=En53vpuc4IkUIOw2dFR3JLHw3nimwxrZJngMjLWejbZR/wRLG1fn04oY1TPAAXrhnM mN+zq+JdB4Kf+MT2DPL53sM/Mg+GYw8fyhUnyoDT77CuI6jvPfATAkfYkEmeqrMU6eFh Tit6P90EuA3mth9Vxgi0cFdDbixUq+5QGgq3LnqXZwHZXE20EzCj/voo74IiNkHWD+iO t/Av7EzCTevq2PL+uoZhgvvrblHLAUpxkm2Kz2WzLKEdtV/UEE7c7TLrlIQxq4FR2xr6 rJnKp1R7ABn8iMJ/oz//k53PCKvJkK1r5bPgO6qpM8AY0dNsHx95YPJkdUFDCrza7Ghj dabg== X-Gm-Message-State: AOUpUlGCR7oIFsv+OYLjWjBRkxSmTzHmg7RmMrILVWY8ckEptJ4l/JhN 2ZyLFO2KA4YxsVypSkbjxQ5tKA== X-Google-Smtp-Source: AA+uWPxuqh/WxcGPymRkgSu0vbbQ4dytEzxPxe01XX8anns4D3ycRy4utWPzmEfNdqIHaqB7Mq+Row== X-Received: by 2002:a5d:4a07:: with SMTP id m7-v6mr3756039wrq.8.1533888384610; Fri, 10 Aug 2018 01:06:24 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:24 -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 Subject: [PATCH v2 27/29] ARM: davinci: mityomapl138: use nvmem notifiers Date: Fri, 10 Aug 2018 10:05:24 +0200 Message-Id: <20180810080526.27207-28-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_090635_616115_7366F349 X-CRM114-Status: GOOD ( 21.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski Stop using the at24_platform_data setup callback in favor of nvmem notifiers. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-mityomapl138.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 35b2b6068a7a..dacc5292f9bd 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include #include @@ -116,10 +118,15 @@ static void mityomapl138_cpufreq_init(const char *partnum) static void mityomapl138_cpufreq_init(const char *partnum) { } #endif -static void read_factory_config(struct nvmem_device *nvmem, void *context) +static int read_factory_config(struct notifier_block *nb, + unsigned long event, void *data) { int ret; const char *partnum = NULL; + struct nvmem_device *nvmem = data; + + if (strcmp(nvmem_dev_name(nvmem), "1-00500") != 0) + return NOTIFY_DONE; if (!IS_BUILTIN(CONFIG_NVMEM)) { pr_warn("Factory Config not available without CONFIG_NVMEM\n"); @@ -151,8 +158,14 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context) bad_config: /* default maximum speed is valid for all platforms */ mityomapl138_cpufreq_init(partnum); + + return NOTIFY_STOP; } +static struct notifier_block mityomapl138_nvmem_notifier = { + .notifier_call = read_factory_config, +}; + static struct nvmem_cell_lookup mityomapl138_nvmem_cells[] = { { .info = { @@ -176,8 +189,6 @@ static struct at24_platform_data mityomapl138_fd_chip = { .byte_len = 256, .page_size = 8, .flags = AT24_FLAG_READONLY | AT24_FLAG_IRUGO, - .setup = read_factory_config, - .context = NULL, }; static struct davinci_i2c_platform_data mityomap_i2c_0_pdata = { @@ -546,6 +557,7 @@ static void __init mityomapl138_init(void) if (ret) pr_warn("spi 1 registration failed: %d\n", ret); + nvmem_register_notifier(&mityomapl138_nvmem_notifier); nvmem_add_lookup_table(mityomapl138_nvmem_cells, ARRAY_SIZE(mityomapl138_nvmem_cells)); mityomapl138_config_emac(); From patchwork Fri Aug 10 08:05:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 652151390 for ; Fri, 10 Aug 2018 08:22:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AFC72B795 for ; Fri, 10 Aug 2018 08:22:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EBB12B7A2; Fri, 10 Aug 2018 08:22:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E24752B795 for ; Fri, 10 Aug 2018 08:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=JwJdgXzy0l1E10c8sk5KTYbSTdM8dA3oXl1y8KfSruY=; b=fcy6IqRl16itjoTogBreA8CuQ+ d+5MlQGqkmDyhTCKnBzJ60w1pbkNYBflhvS3uJPqXwmINwp/DAwIQIwbPCfNQr8TCjeICANG/RlSI 4enfW0jXl1n/ogFBl3eufib0waOMfI8XV0jdN0999SX6yalAM+A026MGbAIYHymANSgmO0BzxlW0c fzaUxNU50omluf6fn6ojGx1XQZOrnN/uQHpIv4iguzT67nOnHVkjJoRiVSvUf26Q/1Go1X6u8TspD NIioeNMHRbaIVuDkGxIYbq/13vL+HBbi1oxYdJ/HNe01jFm8pn5gwQ8cA9/R8+mmJQ2qSru3f5OB9 VjsAb9aA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2gc-0007hl-Fe; Fri, 10 Aug 2018 08:22:18 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2ga-0007WM-Lo for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:22:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bCbrQHeuPnC+JDn+6qaI1RwzcN05FDYJKKTaYUupgdQ=; b=St1WBdYj9E15mi/MBMqZPqX9e Cf6EiylW971adtZ3aoMrSbHAeWwk4KSe+NNyg6iueY4DQiagzk3Z0IX8gpsaUbriX8lyR5ppe2zT/ Yq+QU4543/APTQ2WE/NjX9SfZcIKYa1Qi7/JKlFW93evCwOOVxpb3Z8BHUJnoP1AEkTFNpSUZqhfk Uj+//c2F8ROsvhYqhLi32jv9cR86x/QBFpyk/7Fhgl7WRGu4mNC4QuGfiTuF9kiOgC0J5eM2dZrLu uPmejnz8eEPhhrmksxpurQ9r2ZCf3mzoLZI7S46WbTA2rueepwWH5VZ3+I9DIyQUjVcj0j7Ggd5zV GqE+exryA==; Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2RR-0000hB-HZ for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:42 +0000 Received: by mail-wm0-x242.google.com with SMTP id c14-v6so921626wmb.4 for ; Fri, 10 Aug 2018 01:06:27 -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=bCbrQHeuPnC+JDn+6qaI1RwzcN05FDYJKKTaYUupgdQ=; b=1tQfPHxchGSIBzdu1CdyJ3+sxsPvNbB7Jf+N2w8yfLAogC8MwJ/gToB3EqKlhwn7Rf 2oHaYtcEcH9JT5zsei0r+iphNwjjWhjlT9ZNNTxTMzqyCW9HcrJSckUHkx0LBx7IbMyL Z3iu3tQeF0Tkh3pmTIYf+sM6RAWYVrzz4TiBHtvIdyLlNxnnq8Tr8vW3/Sqhn7TaxHTC z/qODO1CVMNgGusQ2PMhCRKDzs0JtS9g7ofM1v2jtA8+f4ZUkPGwsvcppwe58kykzGJo L4qoUMFe85hXsjFZpc7bf8ReYgvT7/HY3LJ2V7k+DSh2912yFzMDyv8p3dkUhZO4lmSV Wh0Q== 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=bCbrQHeuPnC+JDn+6qaI1RwzcN05FDYJKKTaYUupgdQ=; b=iZxFync+vDaqYLgS2kRnJNCusAcr5LCOlejRJiAfS4/mBZ2oTBHFMzHcJSX9EoWm8x 3xTsW7QaOck3WhFGJZWIVerx5DLKf1Jv59eB2d1TwxcvHhyCKb4GwRzFNUXMCtzmxB8R xG92Utw0Wjv55E1KTfJ7w5Z/+1Rkt7yJ0+SmYym1zphhw9dwou3IvsXDptgAe2L3xbpt M9JCdRUvB6WKJ1h27oA5Tf5chiahWl1kMVtSrJtmHAvLs7aBkou33TVrMd7MLTK/0Dib CDjRBAAfZoEFOtn1ysqMtvG6mK0enSZdEy2j+C4UIxvLzkYx2lM8KYk9T3emDi8n7ix5 4KkQ== X-Gm-Message-State: AOUpUlFn16gSD9izI4tps05KPMlLhJhe1svcU2GykMtxPpWn/KcrEagC 76roES62etdppx/GqpTppQaRJA== X-Google-Smtp-Source: AA+uWPynUmGYa48u4xm44HZ/Y8pTcflvhUT9mEUFwclmi2m/wcBtKScj4dFtxlzhONOLvBNmPoZJgQ== X-Received: by 2002:a1c:aa8f:: with SMTP id t137-v6mr761379wme.54.1533888386561; Fri, 10 Aug 2018 01:06:26 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:25 -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 Subject: [PATCH v2 28/29] ARM: davinci: mityomapl138: use device properties for at24 eeprom Date: Fri, 10 Aug 2018 10:05:25 +0200 Message-Id: <20180810080526.27207-29-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_090637_676917_0A78819D X-CRM114-Status: GOOD ( 20.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We want to work towards phasing out the at24_platform_data structure. There are few users and its contents can be represented using generic device properties. Using device properties only will allow us to significantly simplify the at24 configuration code. Remove the at24_platform_data structure and replace it with an array of property entries. Drop the byte_len/size property, as the model name already implies the EEPROM's size. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- arch/arm/mach-davinci/board-mityomapl138.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index dacc5292f9bd..db50fcce5976 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c @@ -14,13 +14,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include #include @@ -185,10 +185,10 @@ static struct nvmem_cell_lookup mityomapl138_nvmem_cells[] = { } }; -static struct at24_platform_data mityomapl138_fd_chip = { - .byte_len = 256, - .page_size = 8, - .flags = AT24_FLAG_READONLY | AT24_FLAG_IRUGO, +static const struct property_entry mityomapl138_fd_chip_properties[] = { + PROPERTY_ENTRY_U32("pagesize", 8), + PROPERTY_ENTRY_BOOL("read-only"), + { } }; static struct davinci_i2c_platform_data mityomap_i2c_0_pdata = { @@ -317,7 +317,7 @@ static struct i2c_board_info __initdata mityomap_tps65023_info[] = { }, { I2C_BOARD_INFO("24c02", 0x50), - .platform_data = &mityomapl138_fd_chip, + .properties = mityomapl138_fd_chip_properties, }, }; From patchwork Fri Aug 10 08:05:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DEBD13BB for ; Fri, 10 Aug 2018 08:53:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 294F92B838 for ; Fri, 10 Aug 2018 08:53:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B9272B879; Fri, 10 Aug 2018 08:53:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 62A912B838 for ; Fri, 10 Aug 2018 08:53:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=byD3CPfTgX0Lp0d46iTKU8ipDW5d4vIMhq+aXynoRHI=; b=n3/OCarRT9EYc4EHrTT1fdo6FA I6ks7YHuG4k+1YAUtl9o5G3zVdi7D7fiJQUHidb3vCPLty9Xcq9zqlBFjUFhaCqdzAlt1tokM7tzh TPhcD24P4kN+J/QNx9L7GHDaBUHz9CqsMhXEjjNF4/LvS33AD+zngYZBLi3sQ5eAA29XWSPEa5Rt5 OVKQy3d+4ss9Uy3YpYopl+k4r6IsrtsiU0X6YGdIqlqMHOIqOKPRz9PP24wWppHJbEUgrSd+iS/x2 Pb2ZIHzwSrwYqPwrZhwHf8OXqTi4IPld9C7HiQD3OkGm3K0LRHqpI7rNMBBQg9/5AOOdpfjoLKd3W z3M0cmxA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3As-0008IF-0Y; Fri, 10 Aug 2018 08:53:34 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo3AX-0007pj-QP for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:53:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=e8MZoc06XPwOx+HTx71qz+1ze0YvRqXSMwJdLy+VqlY=; b=p5FB24PGrPwsSWchhZE2ts97j t1hAgDcLlklvaaklztXbj0w7pFFn5XRr2EkS3RuT0HyKcDJ2BR+QKStq0RTKeLkxPglLvCETrrWa2 2m9XbXXMyzPcGRTr+2XGGwQLkOWbo/9rQXGbJLjN0Q9YREvr/rF8JRt0l9XGmurdWzOO+BJPZaNjP AmZc6iBMPVGdhHncXBAS2wH4F0rsqq6cAwIgsAyobNa4X7SFyvS8bVjCjABb0Uzr9TWR+ZhPKK0Me zz6yaJ2WrLQdXKclto1n2zokrnHISIt0MCHKtXHolX5bajjz36mOmuD6aMMa0nU0mBbB2LtIEmodx K5T0ZdCNA==; Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2RU-0007dN-Fy for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:42 +0000 Received: by mail-wr1-x442.google.com with SMTP id f12-v6so7433500wrv.12 for ; Fri, 10 Aug 2018 01:06:30 -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=e8MZoc06XPwOx+HTx71qz+1ze0YvRqXSMwJdLy+VqlY=; b=dAefH+KU3MmsNl8saNBtnLclKl6CIohOfNu7uNjH3mmw+GU/9NSBwvRLXnL0zFnxJA 977Zk6bTICu7j8J2JCCh8IgZiU4MXWqYSFrfALCvrIKhssY9ysSv3jBdDaLvMx9PIZjL lx12pejZQgUdwXVkBqtIfEs0SWp0WxUvV4yh43ABmUUiH8Il3fzHrIAZvH+G8KyiMRny YYnAoQAFyt3hjYxN6yv3DJkGo0cojARvlsP1qpcLbeMCCwIbff2j8qZ49fd4pPrJ7M6w b8zbgGqy/yVRKtCFlzbpmJaQJGox/9KJ4fJof8fNnHd1JgQdzEs0eK5POkSG7QAglZ9H LJLg== 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=e8MZoc06XPwOx+HTx71qz+1ze0YvRqXSMwJdLy+VqlY=; b=fN+iA1p9QPY30LwPgntX4atRRsEeGzh9IGatH1ZYXDQdtgS6T2cBrwl34z3ht0CQsq Tn9deAPz6Dx2O1yabk3WqVPsnD8wjI08qINn1nMRbv9/6d5b4TsSOf8BhnleCQa6hxr6 z5v2vy43c5MvhUnlUCO0oSdlqs9QN/9R1E1lkUIK7SwR2ElJkCzS9RcrVwgIKK51lFTK 0Vt6hORrnUK3VnE1mCV97ezFv+U+FZ4GqcMLyLpWm0+fH5jqRiaMtdL1780xrc7e15pQ VZfUjC0M6Qyk5Jz2geIZ8/mcWF5d6IMgHmZlM6LdNeJz5eOIC5ABTQm6vFtgTPSWHB2K y+ww== X-Gm-Message-State: AOUpUlGZxjteeohjMqQ59w4XBWkw+lAq8g1yma+qEkIK3rm6AWTx6ShP 1Q0dWJeKQHyn3czk64FxLzpTzA== X-Google-Smtp-Source: AA+uWPzbDlvAqNHH/9NNGMYVYjxEs6CTeqNl82KanmetTSzXBNalGdBSyfv27BdshOwKoSfe54z0Kg== X-Received: by 2002:adf:f850:: with SMTP id d16-v6mr3295862wrq.172.1533888388488; Fri, 10 Aug 2018 01:06:28 -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 h7-v6sm9546405wrs.8.2018.08.10.01.06.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:27 -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 Subject: [PATCH v2 29/29] eeprom: at24: kill at24_platform_data Date: Fri, 10 Aug 2018 10:05:26 +0200 Message-Id: <20180810080526.27207-30-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_040640_584665_2C8A9360 X-CRM114-Status: GOOD ( 32.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski There are no more users of at24_platform_data. Remove the relevant header and modify the driver code to not use it anymore. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- MAINTAINERS | 1 - drivers/misc/eeprom/at24.c | 127 +++++++++++++---------------- include/linux/platform_data/at24.h | 60 -------------- 3 files changed, 57 insertions(+), 131 deletions(-) delete mode 100644 include/linux/platform_data/at24.h diff --git a/MAINTAINERS b/MAINTAINERS index 7cebd5bba8a8..8eb87a3548f8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2328,7 +2328,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git S: Maintained F: Documentation/devicetree/bindings/eeprom/at24.txt F: drivers/misc/eeprom/at24.c -F: include/linux/platform_data/at24.h ATA OVER ETHERNET (AOE) DRIVER M: "Ed L. Cashin" diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index f5cc517d1131..93642b4b47c5 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -22,10 +22,24 @@ #include #include #include -#include #include #include +/* Address pointer is 16 bit. */ +#define AT24_FLAG_ADDR16 BIT(7) +/* sysfs-entry will be read-only. */ +#define AT24_FLAG_READONLY BIT(6) +/* sysfs-entry will be world-readable. */ +#define AT24_FLAG_IRUGO BIT(5) +/* Take always 8 addresses (24c00). */ +#define AT24_FLAG_TAKE8ADDR BIT(4) +/* Factory-programmed serial number. */ +#define AT24_FLAG_SERIAL BIT(3) +/* Factory-programmed mac address. */ +#define AT24_FLAG_MAC BIT(2) +/* Does not auto-rollover reads to the next slave address. */ +#define AT24_FLAG_NO_RDROL BIT(1) + /* * I2C EEPROMs from most vendors are inexpensive and mostly interchangeable. * Differences between different vendor product lines (like Atmel AT24C or @@ -124,10 +138,6 @@ MODULE_PARM_DESC(at24_write_timeout, "Time (in ms) to try writes (default 25)"); usleep_range(1000, 1500), op_time = jiffies) struct at24_chip_data { - /* - * these fields mirror their equivalents in - * struct at24_platform_data - */ u32 byte_len; u8 flags; }; @@ -467,46 +477,11 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count) return 0; } -static void at24_properties_to_pdata(struct device *dev, - struct at24_platform_data *chip) -{ - int err; - u32 val; - - if (device_property_present(dev, "read-only")) - chip->flags |= AT24_FLAG_READONLY; - if (device_property_present(dev, "no-read-rollover")) - chip->flags |= AT24_FLAG_NO_RDROL; - - err = device_property_read_u32(dev, "size", &val); - if (!err) - chip->byte_len = val; - - err = device_property_read_u32(dev, "pagesize", &val); - if (!err) { - chip->page_size = val; - } else { - /* - * This is slow, but we can't know all eeproms, so we better - * play safe. Specifying custom eeprom-types via platform_data - * is recommended anyhow. - */ - chip->page_size = 1; - } -} - -static int at24_get_pdata(struct device *dev, struct at24_platform_data *pdata) +static const struct at24_chip_data *at24_get_chip_data(struct device *dev) { struct device_node *of_node = dev->of_node; const struct at24_chip_data *cdata; const struct i2c_device_id *id; - struct at24_platform_data *pd; - - pd = dev_get_platdata(dev); - if (pd) { - memcpy(pdata, pd, sizeof(*pdata)); - return 0; - } id = i2c_match_id(at24_ids, to_i2c_client(dev)); @@ -523,13 +498,9 @@ static int at24_get_pdata(struct device *dev, struct at24_platform_data *pdata) cdata = acpi_device_get_match_data(dev); if (!cdata) - return -ENODEV; + return ERR_PTR(-ENODEV); - pdata->byte_len = cdata->byte_len; - pdata->flags = cdata->flags; - at24_properties_to_pdata(dev, pdata); - - return 0; + return cdata; } static void at24_remove_dummy_clients(struct at24_data *at24) @@ -598,8 +569,9 @@ static int at24_probe(struct i2c_client *client) { struct regmap_config regmap_config = { }; struct nvmem_config nvmem_config = { }; - struct at24_platform_data pdata = { }; + const struct at24_chip_data *cdata; struct device *dev = &client->dev; + u32 byte_len, page_size, flags; bool i2c_fn_i2c, i2c_fn_block; unsigned int i, num_addresses; struct at24_data *at24; @@ -613,35 +585,54 @@ static int at24_probe(struct i2c_client *client) i2c_fn_block = i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_I2C_BLOCK); - err = at24_get_pdata(dev, &pdata); + cdata = at24_get_chip_data(dev); + if (IS_ERR(cdata)) + return PTR_ERR(cdata); + + err = device_property_read_u32(dev, "pagesize", &page_size); + if (err) + /* + * This is slow, but we can't know all eeproms, so we better + * play safe. Specifying custom eeprom-types via platform_data + * is recommended anyhow. + */ + page_size = 1; + + flags = cdata->flags; + if (device_property_present(dev, "read-only")) + flags |= AT24_FLAG_READONLY; + if (device_property_present(dev, "no-read-rollover")) + flags |= AT24_FLAG_NO_RDROL; + + err = device_property_read_u32(dev, "size", &byte_len); if (err) - return err; + byte_len = cdata->byte_len; if (!i2c_fn_i2c && !i2c_fn_block) - pdata.page_size = 1; + page_size = 1; - if (!pdata.page_size) { + if (!page_size) { dev_err(dev, "page_size must not be 0!\n"); return -EINVAL; } - if (!is_power_of_2(pdata.page_size)) + if (!is_power_of_2(page_size)) dev_warn(dev, "page_size looks suspicious (no power of 2)!\n"); - if (pdata.flags & AT24_FLAG_TAKE8ADDR) + if (flags & AT24_FLAG_TAKE8ADDR) num_addresses = 8; else - num_addresses = DIV_ROUND_UP(pdata.byte_len, - (pdata.flags & AT24_FLAG_ADDR16) ? 65536 : 256); + num_addresses = DIV_ROUND_UP(byte_len, + (flags & AT24_FLAG_ADDR16) ? 65536 : 256); - if ((pdata.flags & AT24_FLAG_SERIAL) && (pdata.flags & AT24_FLAG_MAC)) { + if ((flags & AT24_FLAG_SERIAL) && (flags & AT24_FLAG_MAC)) { dev_err(dev, "invalid device data - cannot have both AT24_FLAG_SERIAL & AT24_FLAG_MAC."); return -EINVAL; } regmap_config.val_bits = 8; - regmap_config.reg_bits = (pdata.flags & AT24_FLAG_ADDR16) ? 16 : 8; + regmap_config.reg_bits = (flags & AT24_FLAG_ADDR16) ? 16 : 8; regmap_config.disable_locking = true; regmap = devm_regmap_init_i2c(client, ®map_config); @@ -654,11 +645,11 @@ static int at24_probe(struct i2c_client *client) return -ENOMEM; mutex_init(&at24->lock); - at24->byte_len = pdata.byte_len; - at24->page_size = pdata.page_size; - at24->flags = pdata.flags; + at24->byte_len = byte_len; + at24->page_size = page_size; + at24->flags = flags; at24->num_addresses = num_addresses; - at24->offset_adj = at24_get_offset_adj(pdata.flags, pdata.byte_len); + at24->offset_adj = at24_get_offset_adj(flags, byte_len); at24->client[0].client = client; at24->client[0].regmap = regmap; @@ -666,10 +657,10 @@ static int at24_probe(struct i2c_client *client) if (IS_ERR(at24->wp_gpio)) return PTR_ERR(at24->wp_gpio); - writable = !(pdata.flags & AT24_FLAG_READONLY); + writable = !(flags & AT24_FLAG_READONLY); if (writable) { at24->write_max = min_t(unsigned int, - pdata.page_size, at24_io_limit); + page_size, at24_io_limit); if (!i2c_fn_i2c && at24->write_max > I2C_SMBUS_BLOCK_MAX) at24->write_max = I2C_SMBUS_BLOCK_MAX; } @@ -712,7 +703,7 @@ static int at24_probe(struct i2c_client *client) nvmem_config.priv = at24; nvmem_config.stride = 1; nvmem_config.word_size = 1; - nvmem_config.size = pdata.byte_len; + nvmem_config.size = byte_len; at24->nvmem = devm_nvmem_register(dev, &nvmem_config); if (IS_ERR(at24->nvmem)) { @@ -721,13 +712,9 @@ static int at24_probe(struct i2c_client *client) } dev_info(dev, "%u byte %s EEPROM, %s, %u bytes/write\n", - pdata.byte_len, client->name, + byte_len, client->name, writable ? "writable" : "read-only", at24->write_max); - /* export data to kernel code */ - if (pdata.setup) - pdata.setup(at24->nvmem, pdata.context); - return 0; err_clients: diff --git a/include/linux/platform_data/at24.h b/include/linux/platform_data/at24.h deleted file mode 100644 index 63507ff464ee..000000000000 --- a/include/linux/platform_data/at24.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * at24.h - platform_data for the at24 (generic eeprom) driver - * (C) Copyright 2008 by Pengutronix - * (C) Copyright 2012 by Wolfram Sang - * same license as the driver - */ - -#ifndef _LINUX_AT24_H -#define _LINUX_AT24_H - -#include -#include -#include - -/** - * struct at24_platform_data - data to set up at24 (generic eeprom) driver - * @byte_len: size of eeprom in byte - * @page_size: number of byte which can be written in one go - * @flags: tunable options, check AT24_FLAG_* defines - * @setup: an optional callback invoked after eeprom is probed; enables kernel - code to access eeprom via nvmem, see example - * @context: optional parameter passed to setup() - * - * If you set up a custom eeprom type, please double-check the parameters. - * Especially page_size needs extra care, as you risk data loss if your value - * is bigger than what the chip actually supports! - * - * An example in pseudo code for a setup() callback: - * - * void get_mac_addr(struct nvmem_device *nvmem, void *context) - * { - * u8 *mac_addr = ethernet_pdata->mac_addr; - * off_t offset = context; - * - * // Read MAC addr from EEPROM - * if (nvmem_device_read(nvmem, offset, ETH_ALEN, mac_addr) == ETH_ALEN) - * pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr); - * } - * - * This function pointer and context can now be set up in at24_platform_data. - */ - -struct at24_platform_data { - u32 byte_len; /* size (sum of all addr) */ - u16 page_size; /* for writes */ - u8 flags; -#define AT24_FLAG_ADDR16 BIT(7) /* address pointer is 16 bit */ -#define AT24_FLAG_READONLY BIT(6) /* sysfs-entry will be read-only */ -#define AT24_FLAG_IRUGO BIT(5) /* sysfs-entry will be world-readable */ -#define AT24_FLAG_TAKE8ADDR BIT(4) /* take always 8 addresses (24c00) */ -#define AT24_FLAG_SERIAL BIT(3) /* factory-programmed serial number */ -#define AT24_FLAG_MAC BIT(2) /* factory-programmed mac address */ -#define AT24_FLAG_NO_RDROL BIT(1) /* does not auto-rollover reads to */ - /* the next slave address */ - - void (*setup)(struct nvmem_device *nvmem, void *context); - void *context; -}; - -#endif /* _LINUX_AT24_H */