From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH v5 07/11] nvmem: Add simple nvmem-mmio consumer helper functions. Date: Tue, 16 Jun 2015 15:58:13 -0700 Message-ID: <5580AA05.90709@codeaurora.org> References: <1432226535-8640-1-git-send-email-srinivas.kandagatla@linaro.org> <1432226665-8994-1-git-send-email-srinivas.kandagatla@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1432226665-8994-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Srinivas Kandagatla , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: Maxime Ripard , Rob Herring , Kumar Gala , Mark Brown , s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, Greg Kroah-Hartman , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org, mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org List-Id: linux-arm-msm@vger.kernel.org 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 > +#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. > + > + return 0; > +} > +EXPORT_SYMBOL_GPL(nvmem_mmio_probe); Kernel-doc on these exported functions? > 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); -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html