Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755504AbbFRNJA (ORCPT ); Thu, 18 Jun 2015 09:09:00 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:35483 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754989AbbFRNIw (ORCPT ); Thu, 18 Jun 2015 09:08:52 -0400 Message-ID: <5582C2E0.9080503@linaro.org> Date: Thu, 18 Jun 2015 14:08:48 +0100 From: Srinivas Kandagatla User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Stephen Boyd , linux-arm-kernel@lists.infradead.org CC: Maxime Ripard , Rob Herring , Kumar Gala , Mark Brown , s.hauer@pengutronix.de, Greg Kroah-Hartman , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, arnd@arndb.de, pantelis.antoniou@konsulko.com, mporter@konsulko.com Subject: Re: [PATCH v5 07/11] nvmem: Add simple nvmem-mmio consumer helper functions. References: <1432226535-8640-1-git-send-email-srinivas.kandagatla@linaro.org> <1432226665-8994-1-git-send-email-srinivas.kandagatla@linaro.org> <5580AA05.90709@codeaurora.org> In-Reply-To: <5580AA05.90709@codeaurora.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3296 Lines: 112 On 16/06/15 23:58, Stephen Boyd wrote: > On 05/21/2015 09:44 AM, Srinivas Kandagatla wrote: >> diff --git a/drivers/nvmem/nvmem-mmio.c b/drivers/nvmem/nvmem-mmio.c >> new file mode 100644 >> index 0000000..0d8131f >> --- /dev/null >> +++ b/drivers/nvmem/nvmem-mmio.c >> @@ -0,0 +1,69 @@ >> +/* >> + * Copyright (C) 2015 Srinivas Kandagatla >> + * >> + * This program is free software; you can redistribute it and/or modify >> + * it under the terms of the GNU General Public License version 2 and >> + * only version 2 as published by the Free Software Foundation. >> + * >> + * This program is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + * GNU General Public License for more details. >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include > > #include > #include > #include > These are included in nvmem-mmio.h, however for clarity sake I could add them here too. >> +#include "nvmem-mmio.h" >> + >> +int nvmem_mmio_remove(struct platform_device *pdev) >> +{ >> + struct nvmem_device *nvmem = platform_get_drvdata(pdev); >> + >> + return nvmem_unregister(nvmem); >> +} >> +EXPORT_SYMBOL_GPL(nvmem_mmio_remove); >> + >> +int nvmem_mmio_probe(struct platform_device *pdev) >> +{ >> + > [...] >> + >> + platform_set_drvdata(pdev, nvmem); > > It may be better to return the nvmem device instead so that the one > drvdata member is usable by the calling driver. Makes sense.. I will give it a try. > >> + >> + return 0; >> +} >> +EXPORT_SYMBOL_GPL(nvmem_mmio_probe); > > Kernel-doc on these exported functions? Yep, thanks for spotting, I will fix it. > >> diff --git a/drivers/nvmem/nvmem-mmio.h b/drivers/nvmem/nvmem-mmio.h >> new file mode 100644 >> index 0000000..a2ad4e5 >> --- /dev/null >> +++ b/drivers/nvmem/nvmem-mmio.h >> @@ -0,0 +1,41 @@ >> +/* >> + * MMIO based nvmem providers. >> + * >> + * Copyright (C) 2015 Srinivas Kandagatla >> + * >> + * This file is licensed under the terms of the GNU General Public >> + * License version 2. This program is licensed "as is" without any >> + * warranty of any kind, whether express or implied. >> + */ >> + >> +#ifndef _LINUX_NVMEM_MMIO_H >> +#define _LINUX_NVMEM_MMIO_H >> + >> +#include > > Forward declare struct platform_device instead. > >> +#include > > Forward declare nvmem_config instead. > >> +#include > > Forward declare regmap_config instead. > >> + >> +struct nvmem_mmio_data { >> + struct regmap_config *regmap_config; >> + struct nvmem_config *nvmem_config; >> +}; >> + >> +#if IS_ENABLED(CONFIG_NVMEM) >> + >> +int nvmem_mmio_probe(struct platform_device *pdev); >> +int nvmem_mmio_remove(struct platform_device *pdev); > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/