linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Paul Burton <paul.burton@mips.com>,
	James Hogan <jhogan@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	"David S. Miller" <davem@davemloft.net>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>, Evgeniy Polyakov <zbr@ioremap.net>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org, netdev@vger.kernel.org,
	linux-rtc@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH v4 3/9] nvmem: core: add nvmem_device_find
Date: Wed, 14 Aug 2019 13:52:49 +0100	[thread overview]
Message-ID: <31d680ee-ddb3-8536-c915-576222d263e1@linaro.org> (raw)
In-Reply-To: <20190814134616.b4dab3c0aa6ac913d78edb6a@suse.de>



On 14/08/2019 12:46, Thomas Bogendoerfer wrote:
> On Tue, 13 Aug 2019 10:40:34 +0100
> Srinivas Kandagatla <srinivas.kandagatla@linaro.org> wrote:
> 
>>
>>
>> On 09/08/2019 11:32, Thomas Bogendoerfer wrote:
>>> nvmem_device_find provides a way to search for nvmem devices with
>>> the help of a match function simlair to bus_find_device.
>>>
>>> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>>> ---
>>>    drivers/nvmem/core.c           | 62 ++++++++++++++++++++++--------------------
>>>    include/linux/nvmem-consumer.h |  9 ++++++
>>>    2 files changed, 41 insertions(+), 30 deletions(-)
>>
>> Have you considered using nvmem_register_notifier() ?
> 
> yes, that was the first idea. But then I realized I need to build up
> a private database of information already present in nvmem bus. So I
> looked for a way to retrieve it from there. Unfortunately I couldn't
> use bus_find_device directly, because nvmem_bus_type and struct nvmem_device
> is hidden. So I refactured the lookup code and added a more universal
> lookup function, which fits my needs and should be usable for more.
I see your point.

overall the patch as it is look good, but recently we added more generic 
lookups for DT node, looks like part of your patch is un-doing generic 
device name lookup.

DT node match lookup is in 
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/log/?h=generic_lookup_helpers

of_nvmem_match and nvmem_match_name are duplicating the code here.
Looks like its possible to use generic lookups along with custom match 
by splitting __nvmem_device_get() to two functions, one for lookup and 
other for refcounting.

Other missing bit is adding this api to documentation in 
./Documentation/driver-api/nvmem.rst


thanks,
srini
> 
> Thomas.
> 

  reply	other threads:[~2019-08-14 12:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09 10:32 [PATCH v4 0/9] Use MFD framework for SGI IOC3 drivers Thomas Bogendoerfer
2019-08-09 10:32 ` [PATCH v4 1/9] w1: add 1-wire master driver for IP block found in SGI ASICs Thomas Bogendoerfer
2019-08-09 10:32 ` [PATCH v4 2/9] w1: add DS2501, DS2502, DS2505 EPROM device driver Thomas Bogendoerfer
2019-08-09 10:32 ` [PATCH v4 3/9] nvmem: core: add nvmem_device_find Thomas Bogendoerfer
2019-08-13  9:40   ` Srinivas Kandagatla
2019-08-14 11:46     ` Thomas Bogendoerfer
2019-08-14 12:52       ` Srinivas Kandagatla [this message]
2019-08-16 14:09         ` Thomas Bogendoerfer
2019-08-19 16:03           ` Srinivas Kandagatla
2019-08-21 12:48             ` Thomas Bogendoerfer
2019-08-09 10:32 ` [PATCH v4 4/9] MIPS: PCI: refactor ioc3 special handling Thomas Bogendoerfer
2019-08-09 10:32 ` [PATCH v4 5/9] MIPS: PCI: use information from 1-wire PROM for IOC3 detection Thomas Bogendoerfer
2019-08-09 10:32 ` [PATCH v4 6/9] MIPS: SGI-IP27: remove ioc3 ethernet init Thomas Bogendoerfer
2019-08-09 10:32 ` [PATCH v4 8/9] MIPS: SGI-IP27: fix readb/writeb addressing Thomas Bogendoerfer
2019-08-10 13:22   ` Andy Shevchenko
2019-08-11  7:29     ` Greg Kroah-Hartman
2019-08-13  8:47       ` Philippe Mathieu-Daudé
2019-08-14 11:40         ` Thomas Bogendoerfer
2019-08-09 10:32 ` [PATCH v4 9/9] Input: add IOC3 serio driver Thomas Bogendoerfer
2019-08-09 22:04   ` Dmitry Torokhov
2019-08-14 13:20   ` Jonas Gorski
2019-08-14 14:37     ` Thomas Bogendoerfer
2019-08-14 16:57       ` Jonas Gorski
2019-08-14 18:04         ` Dmitry Torokhov
     [not found] ` <20190809103235.16338-8-tbogendoerfer@suse.de>
2019-08-09 21:22   ` [PATCH v4 7/9] mfd: ioc3: Add driver for SGI IOC3 chip Jakub Kicinski
2019-08-11  7:32     ` Thomas Bogendoerfer
2019-08-12 19:52       ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31d680ee-ddb3-8536-c915-576222d263e1@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jhogan@kernel.org \
    --cc=jslaby@suse.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=tbogendoerfer@suse.de \
    --cc=zbr@ioremap.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).