Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp700919ybl; Wed, 14 Aug 2019 04:47:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHqTyxKOuD1B6p5OAmRymXpxIsts1KD4y79zUBsBlHTqVs2eFc+ItgxpeAvw/DSagislGl X-Received: by 2002:a62:26c4:: with SMTP id m187mr10930880pfm.49.1565783232614; Wed, 14 Aug 2019 04:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565783232; cv=none; d=google.com; s=arc-20160816; b=RxGf2jnPN2V4Bd5ClvLIzzMInrTdMeWhkRyyhEn9tRFHRZD9mLwTADKdc9g+Dp2X6S WS63e9ir6x3W80XA59HorxLCpYwhaz2+wSDN9oTKXuZ/nLy0/rQavsm7APsFyZrjVNm+ c25YrHLFWSsw//cMDAqsR63OVP3pWskM4CMbQfkH260tcGD560DkmL2khEJNDe8TnD3R jNesYRzw3W17IiF4mX0lbi5++roV/ZCYbL9/85NseH9/pzk7VOU3J2wKrENj47M2LDbu 2SHE7zklQIbTHQx6su6fCqwGR1toKhZp8caM13A/LuGIvZ3aDaLoQuz06rQG1n2edgyl 0BLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=KxGjXFaBtR4U30+IZqD9SSXyaCRtsqlNmVjy/NYU/2A=; b=cE9X9I09MbzYQsABwv1MQAbJKTprpq/XAtK//MdcRS3qwju//DaYSKZTX8CaMd6lA0 UPv1Q5rCBfh0sXcyDPTPcGG4thzJG6RI0Jrul6qpbqTWKYQ/6GyxZDAk5ymFlu9KVCkW 5hO2CpAvv0tIS24q/iclDfjWLp8KbiBYhZJfTQn0DW7cSsDqBrTx0+ISLyTVm7++v/6x QiyxNykTXlkljWlBCu8rhL6xblfFNUFXzR7sZO3Uu4DwE7rx3WoofqrFtyQYUd1ruu5Q JSFRvj4CUjrInncjjU5CUe3D1K0kcuT77t0ggKdi07iWaBpymWtIH+o3qnRY5peB2R/O xx8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si35680889pgp.261.2019.08.14.04.46.55; Wed, 14 Aug 2019 04:47:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727122AbfHNLqT convert rfc822-to-8bit (ORCPT + 99 others); Wed, 14 Aug 2019 07:46:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:43796 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725800AbfHNLqS (ORCPT ); Wed, 14 Aug 2019 07:46:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EFF61AF5B; Wed, 14 Aug 2019 11:46:16 +0000 (UTC) Date: Wed, 14 Aug 2019 13:46:16 +0200 From: Thomas Bogendoerfer To: Srinivas Kandagatla Cc: Ralf Baechle , Paul Burton , James Hogan , Dmitry Torokhov , Lee Jones , "David S. Miller" , Alessandro Zummo , Alexandre Belloni , Greg Kroah-Hartman , Jiri Slaby , Evgeniy Polyakov , 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 Message-Id: <20190814134616.b4dab3c0aa6ac913d78edb6a@suse.de> In-Reply-To: <8d18de64-9234-fcba-aa3d-b46789eb62a5@linaro.org> References: <20190809103235.16338-1-tbogendoerfer@suse.de> <20190809103235.16338-4-tbogendoerfer@suse.de> <8d18de64-9234-fcba-aa3d-b46789eb62a5@linaro.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Aug 2019 10:40:34 +0100 Srinivas Kandagatla 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 > > --- > > 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. Thomas. -- SUSE Linux GmbH GF: Felix Imend?rffer, Mary Higgins, Sri Rasiah HRB 21284 (AG N?rnberg)