Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966586AbdLSIwz (ORCPT ); Tue, 19 Dec 2017 03:52:55 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:54188 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938714AbdLSIwt (ORCPT ); Tue, 19 Dec 2017 03:52:49 -0500 Date: Tue, 19 Dec 2017 09:52:50 +0100 From: Greg Kroah-Hartman To: Boris Brezillon Cc: Wolfram Sang , linux-i2c@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Arnd Bergmann , Przemyslaw Sroka , Arkadiusz Golec , Alan Douglas , Bartosz Folta , Damian Kos , Alicja Jurasik-Urbaniak , Cyprian Wronka , Suresh Punnoose , Thomas Petazzoni , Nishanth Menon , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vitor Soares , Geert Uytterhoeven , Linus Walleij Subject: Re: [PATCH v2 2/7] i3c: Add core I3C infrastructure Message-ID: <20171219085250.GC15010@kroah.com> References: <20171214151610.19153-1-boris.brezillon@free-electrons.com> <20171214151610.19153-3-boris.brezillon@free-electrons.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171214151610.19153-3-boris.brezillon@free-electrons.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1957 Lines: 60 On Thu, Dec 14, 2017 at 04:16:05PM +0100, Boris Brezillon wrote: > +/** > + * i3c_device_match_id() - Find the I3C device ID entry matching an I3C dev > + * @i3cdev: the I3C device we're searching a match for > + * @id_table: the I3C device ID table > + * > + * Return: a pointer to the first entry matching @i3cdev, or NULL if there's > + * no match. > + */ > +const struct i3c_device_id * > +i3c_device_match_id(struct i3c_device *i3cdev, > + const struct i3c_device_id *id_table) > +{ > + const struct i3c_device_id *id; > + > + /* > + * The lower 32bits of the provisional ID is just filled with a random > + * value, try to match using DCR info. > + */ > + if (!I3C_PID_RND_LOWER_32BITS(i3cdev->info.pid)) { > + u16 manuf = I3C_PID_MANUF_ID(i3cdev->info.pid); > + u16 part = I3C_PID_PART_ID(i3cdev->info.pid); > + u16 ext_info = I3C_PID_EXTRA_INFO(i3cdev->info.pid); > + > + /* First try to match by manufacturer/part ID. */ > + for (id = id_table; id->match_flags != 0; id++) { > + if ((id->match_flags & I3C_MATCH_MANUF_AND_PART) != > + I3C_MATCH_MANUF_AND_PART) > + continue; > + > + if (manuf != id->manuf_id || part != id->part_id) > + continue; > + > + if ((id->match_flags & I3C_MATCH_EXTRA_INFO) && > + ext_info != id->extra_info) > + continue; > + > + return id; > + } > + } > + > + /* Fallback to DCR match. */ > + for (id = id_table; id->match_flags != 0; id++) { > + if ((id->match_flags & I3C_MATCH_DCR) && > + id->dcr == i3cdev->info.dcr) > + return id; > + } > + > + return NULL; > +} > +EXPORT_SYMBOL_GPL(i3c_device_match_id); I just picked one random export here, but it feels like you are exporting a bunch of symbols you don't need to. Why would something outside of the i3c "core" need to call this function? Have you looked to see if you really have callers for everything you are exporting? Other than that, the driver core interaction looks good now, nice job. greg k-h