Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3258289yba; Tue, 16 Apr 2019 07:49:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0+/7sieF/DrYkco1Gq5idmEO/kFaNbr+5LsBPQEfRv1dgTuWsyTsRLg8KkfvLPKOMVtZO X-Received: by 2002:a17:902:184:: with SMTP id b4mr62271152plb.26.1555426181090; Tue, 16 Apr 2019 07:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555426181; cv=none; d=google.com; s=arc-20160816; b=Nlod6br955hTtopoJnpeed11qK2aJk70ym3aTqk4JDewSldCKjE8da9FAODMiqVjgR Kolf9UR/07wM/fuKCSp0tpP6IeyKv3XXOP/ZOuwgO7qlDWH6hz4dggCK/HNWNfOSCtNh r6seBGh7gW51hd6Aj/rzR9o5HG1sqYeV6fODxAuOTmsKghvzOGh87AQFVjAV48CoDQwl bKc+F1JcBonNSRb4wLFZhpLpr+Sw6G1Nbb9i28ejMaMGdYKtAoMC0JgywaPNiM6WDF3E psnnFG1hDt7CW4SsBOlGS/bO2YpI5JXXKOabMOkGEhLDTVZrifHCNTbXhv7aAQeIBpJ0 4nMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=6e3MNu9QL4hmIjaHxxnCJ177JoLgPGl5VgLmA5sjy7Y=; b=o4RAHeG1B0FpspF/n029F8DurQ128uGoHF4RrBPGFQJpovKcxOWQb0dakCg32xbEh8 jTmkZMuhNTss9PImzvIQ2g2cX7bq1uSvVzQR8B0PhmuybVHmFsgA9GHGFszLL5DS9GoA PyA86aoNmNwm6ijtdUXnouTufpImbcfqmiiVA87X9gnOM4mV0IsxcTOIghV3tBsSDtv3 idQLeV3ghnSRGqznJJvcxdMM4klZ8SzSOrsR5yYgG6kGrHvEza8PPZavsf5/wEWIEWsM FgpMx2wY7XowNeEaf4rdJwOu/LqSLj/V2dQ6faG4MMlLqfEwqYanRroeXh58a3hbwWUx MPyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=Wl2jj6um; 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=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si47187061ple.218.2019.04.16.07.49.24; Tue, 16 Apr 2019 07:49:41 -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; dkim=pass header.i=@synopsys.com header.s=mail header.b=Wl2jj6um; 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=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729433AbfDPOsh (ORCPT + 99 others); Tue, 16 Apr 2019 10:48:37 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:59720 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726641AbfDPOsg (ORCPT ); Tue, 16 Apr 2019 10:48:36 -0400 Received: from mailhost.synopsys.com (dc8-mailhost2.synopsys.com [10.13.135.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtprelay.synopsys.com (Postfix) with ESMTPS id 57D3024E2140; Tue, 16 Apr 2019 07:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1555426116; bh=D3yDYgE9nkI0VAfOP49ZeJQZXPSpona/6v/OY+Y2fUs=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=Wl2jj6umaYnm4Y7vzgFpO5U3v0ntAE41tS/o5wFTdOsPWgDtO/+I9O/Wnm5DiNpQT Ginqi/BFOpOtzN/JjOLVqHdZ7zHcnVIoFvZ6nbnMowRDt3BDrccG3bdo1E0r77SnLe o66rOVmtaYCMzopVppBQM2uF35GsxPTWamvK8dUjhQy9nTlVAPqW0qveF3Rt2rezRj aAPp6cIfio6vqnbTrgmugxKLFAkjcx3DSWor1EDwqVwc8/+3qeP/ovembnyRXqjL+B K9NfnJSuZJ7WhmeYu8ikuuXNq1YZaUVM3Yeb7pQi0PaJ8w9K9LWprY7eThs9M8Kgua METAfEyu2J3hA== Received: from us01wehtc1.internal.synopsys.com (us01wehtc1-vip.internal.synopsys.com [10.12.239.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id 5F725A023A; Tue, 16 Apr 2019 14:48:29 +0000 (UTC) Received: from DE02WEHTCB.internal.synopsys.com (10.225.19.94) by us01wehtc1.internal.synopsys.com (10.12.239.231) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 16 Apr 2019 07:48:29 -0700 Received: from DE02WEMBXB.internal.synopsys.com ([fe80::95ce:118a:8321:a099]) by DE02WEHTCB.internal.synopsys.com ([::1]) with mapi id 14.03.0415.000; Tue, 16 Apr 2019 16:48:26 +0200 From: Vitor Soares To: Boris Brezillon , 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 Thread-Topic: [PATCH 2/3] i3c: Add i3c_get_device_id helper Thread-Index: AQHU88A5tZAS2U8h5UGt/7MTI0gtHaY+L16AgACuToA= Date: Tue, 16 Apr 2019 14:48:26 +0000 Message-ID: <13D59CF9CEBAF94592A12E8AE55501350A6159AD@DE02WEMBXB.internal.synopsys.com> References: <33ba7e13816fcece0a2f7ec917c18807359c16c7.1555354268.git.vitor.soares@synopsys.com> <20190416081825.2d17b771@collabora.com> In-Reply-To: <20190416081825.2d17b771@collabora.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-dg-ref: =?us-ascii?Q?PG1ldGE+PGF0IG5tPSJib2R5LnR4dCIgcD0iYzpcdXNlcnNcc29hcmVzXGFw?= =?us-ascii?Q?cGRhdGFccm9hbWluZ1wwOWQ4NDliNi0zMmQzLTRhNDAtODVlZS02Yjg0YmEy?= =?us-ascii?Q?OWUzNWJcbXNnc1xtc2ctYWVhZWJjMTItNjA1Ni0xMWU5LTgyM2EtZDQ4MWQ3?= =?us-ascii?Q?ODUxODBmXGFtZS10ZXN0XGFlYWViYzEzLTYwNTYtMTFlOS04MjNhLWQ0ODFk?= =?us-ascii?Q?Nzg1MTgwZmJvZHkudHh0IiBzej0iMjE5OCIgdD0iMTMxOTk4OTk3MDQ1NjUw?= =?us-ascii?Q?NzMwIiBoPSJ1eVIrUmtZWU14cVlIWDV6ZmY2bE1vTU0wOVE9IiBpZD0iIiBi?= =?us-ascii?Q?bD0iMCIgYm89IjEiIGNpPSJjQUFBQUVSSFUxUlNSVUZOQ2dVQUFCUUpBQUFx?= =?us-ascii?Q?SloxeFkvVFVBUkttNUVRME1BTTBFcWJrUkRRd0F6UU9BQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBSEFBQUFDa0NBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?RUFBUUFCQU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QUFBQUFBQUFBQUFBQkFBQUFBQUFBQUFJQUFBQUFBSjRBQUFC?= =?us-ascii?Q?ekFHNEFjQUJ6QUY4QWJBQnBBR01BWlFCdUFITUFaUUJmQUhRQVpRQnlBRzBB?= =?us-ascii?Q?WHdCekFIUUFkUUJrQUdVQWJnQjBBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUVBQUFBQUFBQUFBZ0FBQUFBQW5nQUFBSFlBWndCZkFHc0FaUUI1?= =?us-ascii?Q?QUhjQWJ3QnlBR1FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFRQUFBQUFB?= =?us-ascii?Q?QUFBQ0FBQUFBQUE9Ii8+PC9tZXRhPg=3D=3D?= x-originating-ip: [10.107.25.87] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, From: Boris Brezillon Date: Tue, Apr 16, 2019 at 07:18:25 > On Mon, 15 Apr 2019 21:19:40 +0200 > Vitor Soares wrote: >=20 > > This helper return the i3c_device_id structure in order the client > > have access to the driver data. > >=20 > > Signed-off-by: Vitor Soares > > --- > > drivers/i3c/device.c | 8 ++++++++ > > include/linux/i3c/device.h | 1 + > > 2 files changed, 9 insertions(+) > >=20 > > 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 *de= v) > > } > > EXPORT_SYMBOL_GPL(dev_to_i3cdev); > > =20 > > +const struct i3c_device_id *i3c_get_device_id(struct i3c_device *i3cde= v) > > +{ > > + const struct i3c_driver *i3cdrv =3D drv_to_i3cdrv(i3cdev->dev.driver)= ; > > + > > + return i3cdrv->id_table; > > +} > > +EXPORT_SYMBOL_GPL(i3c_get_device_id); >=20 > I think what you want is i3c_device_match_id().=20 I want the i3c_device_id struct of an i3c_device. What is the name that=20 you suggest? >Just move the function > to drivers/i3c/device.c, export it and define its prototype in > include/i3c/device.h. You are right, this should go for the device side. >=20 > > + > > /** > > * 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(stru= ct device_driver *drv) > > =20 > > 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 *i3cde= v); > > =20 > > static inline void i3cdev_set_drvdata(struct i3c_device *i3cdev, > > void *data) Best regards, Vitor Soares