Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8374287ybi; Thu, 6 Jun 2019 11:09:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwt8PNKZMvzuvIBzgEpdpVkv4q93dWs8n99M2+T1ydPOjUsmUeugwR2W+kxfsZ6ewP4VWr5 X-Received: by 2002:aa7:910e:: with SMTP id 14mr54359548pfh.153.1559844583484; Thu, 06 Jun 2019 11:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559844583; cv=none; d=google.com; s=arc-20160816; b=mWudwnsLxB48kphHAlyxcdsQgONr4oLxVmw1a7Yvqw4Beydwgjwa3GtJu0pniBu7S6 dtd91tjbHEXAmqWgEN9BOjDGNgGsdr6A6j1Fx5D6+xL2wI8o4VkDqnWG15BQuOghT2He eKDT3sWgTQ3vsESR1XhO4fp4IFQil72ohqoPzVSWo1zGs4/DQYqAE5AmIMLCbj+onTBX teJ4KRIGaNpDrW7U2Gt7h+DCLaP3r24APWhLChdQy6Uk0WmJ7Kcx0jxL6DOVEEyvNxu8 eRPk4d3H9PxU9sfTaweG5XsGbqYwbdb2+VjqWmWhkvDTYRnbMQo95WHgM2RiYhxB4t21 m34Q== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=3rxfQz+l0G4DJ807CO2flWrXd7Q+GlWqj1bRQeBn60M=; b=xC4JBePzXw0xI7iHSFxHhQVB1Xdc+8iOCy2mKnzwmk1qdUkKmTouqNysmqbxQCpgnj LzLtX6XU7rwG0UooCuvDUUZtB0y0GOm9kN1S+inTUiwwr0h0fqA+W7xbNvr1o1NVaUSz GfwIW/p/1jaBxI25DcqdIufySFuFO4a2MNW0ax/WFyiM+TuR1vncxDnWQWIxl6GALQUt 5ptVJ2SpCG2QO52fzK9Du+esd4M/pVuzHDFSzOBSJqIORua01+98ocOneVtfZdx+TjXn MB/oX4U4tEWse8GIooAHnM3JJh8P6+/aGIGZ0G8FW5HsyCxjEiPRvdUEkHYldJJ/oK5p dnPw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si2643027pgj.54.2019.06.06.11.09.26; Thu, 06 Jun 2019 11:09:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729221AbfFFPSA (ORCPT + 99 others); Thu, 6 Jun 2019 11:18:00 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:58866 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729029AbfFFPSA (ORCPT ); Thu, 6 Jun 2019 11:18:00 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 31276260D74; Thu, 6 Jun 2019 16:17:58 +0100 (BST) Date: Thu, 6 Jun 2019 17:17:55 +0200 From: Boris Brezillon To: Vitor Soares Cc: linux-iio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, broonie@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, bbrezillon@kernel.org, Joao.Pinto@synopsys.com, lorenzo.bianconi83@gmail.com Subject: Re: [PATCH v2 2/3] i3c: add i3c_get_device_id helper Message-ID: <20190606171755.0feb8998@collabora.com> In-Reply-To: References: Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Jun 2019 17:12:03 +0200 Vitor Soares wrote: > This helper return the i3c_device_id structure in order the client > have access to the driver data. > > Signed-off-by: Vitor Soares > --- > Changes in v2: > move this function to drivers/i3c/device.c > > drivers/i3c/device.c | 8 ++++++++ > include/linux/i3c/device.h | 1 + > 2 files changed, 9 insertions(+) > > diff --git a/drivers/i3c/device.c b/drivers/i3c/device.c > index 69cc040..a6d0796 100644 > --- a/drivers/i3c/device.c > +++ b/drivers/i3c/device.c > @@ -200,6 +200,14 @@ struct i3c_device *dev_to_i3cdev(struct device *dev) > } > EXPORT_SYMBOL_GPL(dev_to_i3cdev); > > +const struct i3c_device_id *i3c_get_device_id(struct i3c_device *i3cdev) > +{ > + const struct i3c_driver *i3cdrv = drv_to_i3cdrv(i3cdev->dev.driver); > + > + return i3cdrv->id_table; > +} > +EXPORT_SYMBOL_GPL(i3c_get_device_id); That's not what I asked. I told you to expose i3c_device_match_id() which already exists and is in master.c. What you really want is to get the device_id entry that matches your device, not the first entry in the table... > + > /** > * i3c_driver_register_with_owner() - register an I3C device driver > * > diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h > index 5ecb055..e0415e1 100644 > --- a/include/linux/i3c/device.h > +++ b/include/linux/i3c/device.h > @@ -187,6 +187,7 @@ static inline struct i3c_driver *drv_to_i3cdrv(struct device_driver *drv) > > struct device *i3cdev_to_dev(struct i3c_device *i3cdev); > struct i3c_device *dev_to_i3cdev(struct device *dev); > +const struct i3c_device_id *i3c_get_device_id(struct i3c_device *i3cdev); > > static inline void i3cdev_set_drvdata(struct i3c_device *i3cdev, > void *data)