Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754591AbbFRM6O (ORCPT ); Thu, 18 Jun 2015 08:58:14 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:36874 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752490AbbFRM6D (ORCPT ); Thu, 18 Jun 2015 08:58:03 -0400 Message-ID: <5582C055.6040908@linaro.org> Date: Thu, 18 Jun 2015 13:57:57 +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 05/11] nvmem: Add nvmem_device based consumer apis. References: <1432226535-8640-1-git-send-email-srinivas.kandagatla@linaro.org> <1432226603-8863-1-git-send-email-srinivas.kandagatla@linaro.org> <5580A7EA.2090909@codeaurora.org> In-Reply-To: <5580A7EA.2090909@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: 3875 Lines: 128 On 16/06/15 23:49, Stephen Boyd wrote: > On 05/21/2015 09:43 AM, Srinivas Kandagatla wrote: >> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c >> index 8a4b358..68ee8d1 100644 >> --- a/drivers/nvmem/core.c >> +++ b/drivers/nvmem/core.c >> @@ -436,6 +436,51 @@ static int __nvmem_device_put(struct nvmem_device *nvmem) >> return 0; >> } >> >> +static int nvmem_match(struct device *dev, const void *data) >> +{ >> + return !strcmp(dev_name(dev), (const char *)data); > > Unnecessary cast. Sure, will fix it. > >> +} >> + >> +static struct nvmem_device *nvmem_find(const char *name) >> +{ >> + struct device *d; >> + >> + d = class_find_device(&nvmem_class, NULL, (void *)name, nvmem_match); > > Unnecessary cast Will fix it. > >> + >> + return d ? to_nvmem_device(d) : NULL; >> +} > > [...] >> + >> +void nvmem_device_put(struct nvmem_device *nvmem) >> +{ >> + __nvmem_device_put(nvmem); >> +} >> +EXPORT_SYMBOL_GPL(nvmem_device_put); >> >> +int nvmem_device_cell_read(struct nvmem_device *nvmem, >> + struct nvmem_cell_info *info, void *buf) >> +{ >> +} >> +EXPORT_SYMBOL_GPL(nvmem_device_cell_read); >> + >> +int nvmem_device_cell_write(struct nvmem_device *nvmem, >> + struct nvmem_cell_info *info, void *buf) >> +{ >> +} >> +EXPORT_SYMBOL_GPL(nvmem_device_cell_write); >> + >> +int nvmem_device_read(struct nvmem_device *nvmem, >> + unsigned int offset, >> + size_t bytes, void *buf) >> +{ >> +} >> +EXPORT_SYMBOL_GPL(nvmem_device_read); >> + >> +int nvmem_device_write(struct nvmem_device *nvmem, >> + unsigned int offset, >> + size_t bytes, void *buf) >> +{ >> +} >> +EXPORT_SYMBOL_GPL(nvmem_device_write); > > Can you please add kernel-doc on these exported APIs? > Thanks for spotting, I will add them. >> + >> static int nvmem_init(void) >> { >> return class_register(&nvmem_class); >> diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h >> index c3fa8c7..66c67ba 100644 >> --- a/include/linux/nvmem-consumer.h >> +++ b/include/linux/nvmem-consumer.h >> @@ -23,6 +32,18 @@ void nvmem_cell_put(struct nvmem_cell *cell); >> void *nvmem_cell_read(struct nvmem_cell *cell, ssize_t *len); >> int nvmem_cell_write(struct nvmem_cell *cell, void *buf, ssize_t len); >> >> +/* direct nvmem device read/write interface */ >> +struct nvmem_device *nvmem_device_get(struct device *dev, const char *name); >> +void nvmem_device_put(struct nvmem_device *nvmem); >> +int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset, >> + size_t bytes, void *buf); >> +int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset, >> + size_t bytes, void *buf); >> +int nvmem_device_cell_read(struct nvmem_device *nvmem, >> + struct nvmem_cell_info *info, void *buf); >> +int nvmem_device_cell_write(struct nvmem_device *nvmem, >> + struct nvmem_cell_info *info, void *buf); >> + > > Can we also have devm_nvmem_*_get() APIs please? Sure, I will spin it in next version. > >> diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h >> index 4908b37..7a982cd 100644 >> --- a/include/linux/nvmem-provider.h >> +++ b/include/linux/nvmem-provider.h >> @@ -12,15 +12,9 @@ >> #ifndef _LINUX_NVMEM_PROVIDER_H >> #define _LINUX_NVMEM_PROVIDER_H >> >> -struct nvmem_device; >> +#include >> >> -struct nvmem_cell_info { >> - const char *name; >> - int offset; >> - int bytes; >> - int bit_offset; >> - int nbits; >> -}; >> +struct nvmem_device; > > Should this diff be part of an earlier patch? Possibly, something wrong with this diff, I will fix it. > -- 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/