Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2883529yba; Mon, 15 Apr 2019 23:20:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxjaR6l65cify4EfbX7qt2zVTnD/sd6cdXXXMHj/Ud4JI8zXmr8MtzQiL627G5xR7+gFMl X-Received: by 2002:a17:902:2862:: with SMTP id e89mr61452925plb.203.1555395634944; Mon, 15 Apr 2019 23:20:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555395634; cv=none; d=google.com; s=arc-20160816; b=FzcZHGJBnjvwXmJ7yrY5Z7TjRKK5Jhdr11BQco6Q5yTV6fNzU06kvDzh98OdOpPGMz a5FN5TCgba/Uo3/uWA/Up3dZJaQnmDWxxZVZf3Oz39o6lML1m1kdXRlA9vafKX6SsxYR fTeygwvPBgW6BVRGcW7wgo/z8ZpDxT9M8AhOlRu5o5iHbZHzv9hbrRGfk26OrgTn2sSB JhAXzBlOJVpuGe/k4UP6SpZBYactzcxLSngfVIuQT0YRP/8sa5uF+XFO7dq/oBXZ+cJz 88v5sHjz+aAKBaOiBHFhcYJVqYdT1szYexuMP0R6zbUPuWVznEs6bTDZDDUvyaMt/H+D weOA== 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=cv8ymLqvxJqZeNu7B4HIc+tULyCiiHD+25IMddrzVmM=; b=LfLo5VOaj6n3Mx6nwMHWoJ0BVlpU8Ktart81GpEFM8e8vwlUDk2+7bfSFq0uGAoWnY Bl/yvA/qd3pphA3KasfXP8foZ4cvll5pEAbTxqK9uA357J7lu2uZp0DYX5ayk5wO/VBG PJqzVfsBbjeZe3EK9CFtVPx+0e1edRqQHocVhLZxyDADnnORUGVfhfIvO74i+2ajxWak XD/eq8E32AdfMKqDVowy/YDZhcTX3oO8b25V4OGDHBjuNwA2Xv9Dt7bkDXDvyJVwZFjf 1Rvw5h1eY7REDD9HJ0lORCWwNEeCItFvu8o0JiHzyCuFBRiwqT2vsjJaLKr+keEGA3PM Frxg== 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 31si24489984plk.42.2019.04.15.23.20.17; Mon, 15 Apr 2019 23:20:34 -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 S1727638AbfDPGSa (ORCPT + 99 others); Tue, 16 Apr 2019 02:18:30 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:48244 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbfDPGSa (ORCPT ); Tue, 16 Apr 2019 02:18:30 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:b93f:9fae:b276:a89a]) (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 52A84260C42; Tue, 16 Apr 2019 07:18:28 +0100 (BST) Date: Tue, 16 Apr 2019 08:18:25 +0200 From: Boris Brezillon To: Vitor Soares Cc: linux-iio@vger.kernel.org, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, pmeerw@pmeerw.net, lars@metafoo.de, knaack.h@gmx.de, jic23@kernel.org, lorenzo.bianconi83@gmail.com, bbrezillon@kernel.org, rafael@kernel.org, gregkh@linuxfoundation.org, broonie@kernel.org, joao.pinto@synopsys.com Subject: Re: [PATCH 2/3] i3c: Add i3c_get_device_id helper Message-ID: <20190416081825.2d17b771@collabora.com> In-Reply-To: <33ba7e13816fcece0a2f7ec917c18807359c16c7.1555354268.git.vitor.soares@synopsys.com> References: <33ba7e13816fcece0a2f7ec917c18807359c16c7.1555354268.git.vitor.soares@synopsys.com> 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 Mon, 15 Apr 2019 21:19:40 +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 > --- > 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 472be99..8ab8e4c 100644 > --- a/drivers/i3c/device.c > +++ b/drivers/i3c/device.c > @@ -235,6 +235,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); I think what you want is i3c_device_match_id(). Just move the function to drivers/i3c/device.c, export it and define its prototype in include/i3c/device.h. > + > /** > * 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 7ee7e30..ee48886 100644 > --- a/include/linux/i3c/device.h > +++ b/include/linux/i3c/device.h > @@ -211,6 +211,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)