Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8197176ybi; Thu, 6 Jun 2019 08:13:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzdE/cYsKYFJqgGtU9CmdqrwSWUmPAYGP65I+WosrTrU156xWHVLGc0Xfs/cltYwLWikKn X-Received: by 2002:aa7:824b:: with SMTP id e11mr52004716pfn.33.1559834030497; Thu, 06 Jun 2019 08:13:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559834030; cv=none; d=google.com; s=arc-20160816; b=MBv/o2e9edXFrDkMtgOo/T2Dz1VD8Hsahzd2yhizXod3A3K547yCoNWGarKEsYOj8c gEHeh/9if6DzEtMG51x2ze8KZGUfXh4SttfYEh9cwWbSYfzF8RXf7qRjUg9c0C2IADvb MrHwwYrjmO2rrfRcBbiKa+stwCVJEwF13DZQLv9GAPgXhrY5EaJtJT4LRuofT5fqJYWL aEWiV1XIH/5AMOuUh5lT5QtlVJSU7pPZVwyaGK4UwHaVGjxALUjmhKNwO3USyGSJDHDZ 2i1uw1dUaOekLMEY4xRZiayI7h245rB4yJJEZAxKiupgNqVHxvPjXNCmMMJUKN2MSW4v 9sFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=R2gkPsRT8yzn7lInDZwnoLg/4L3u2Y7ZFn4W4SaQCWI=; b=ihPMYmx6oDHTvEXmc5+j9KZnqZBaXiDC0dwJBHJ0A4IZuuUw1xAvFohU+PIU93373O 90wyXP0THh0YLe6opRGirlKMYHBVZw11gO1rmxBeaR2lKKcmRWu7U94yywTKB2f95eIz hvwa6Mn06mFujSdTv9FBps6VA2Z0kOMiO7hTuoexf8OriUhwJr1x+otW1Ymf/4PVdCP4 LTQWycAyf/zgV3w3tN2Z7I6zYZ87Vad3niaVfVYU2xauZ2c8lSRUYZY46gHHrCkzvrX4 vvmAipnOjxHpTwK3yoKK7MqGX842V5ukBnC1DWDSIOhmCCZRbNEe+/YEmyhTY8UtH5dj HXew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=bwshtbRg; 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 m2si2145894pgv.89.2019.06.06.08.13.32; Thu, 06 Jun 2019 08:13:50 -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=bwshtbRg; 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 S1729202AbfFFPMP (ORCPT + 99 others); Thu, 6 Jun 2019 11:12:15 -0400 Received: from dc8-smtprelay2.synopsys.com ([198.182.47.102]:40300 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728812AbfFFPML (ORCPT ); Thu, 6 Jun 2019 11:12:11 -0400 Received: from mailhost.synopsys.com (unknown [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 9DBF9C0B59; Thu, 6 Jun 2019 15:12:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1559833942; bh=+7+5ObOc7gxS4v0EaTYk0LsyMtKGB6jikkVK2HcAVnU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=bwshtbRgM1A3pmPkIenFpKszEIHXHty90zKvVrCs9P8ZrOutl1tmnXQyCP5qNoMJ1 K12aDk3pPTLUOkygUkq9oYTgQZV7vnPt7P+L1cJ3+Maol3iKz3AEenl6WooXAM8Ist GJlHzOnqKh69Dcc9iV9f5BbXQ5szeKp97e+ptvxp+TfMBM3P9qPfhLra8r+YgQILtY elN5BSZGTc/XkkrjWg4nSil53usiI9rvovi08/5du6YOCrPvWjBGZ0Q9XykclDUkl2 WB8WZ3983Nx7EuJ1U/VDCsDFCb3NxV8bzatxYdI5tSMD+qodxvKbunoKdOsHfRF17w LnnMO+NhWxIYw== Received: from de02.synopsys.com (germany.internal.synopsys.com [10.225.17.21]) by mailhost.synopsys.com (Postfix) with ESMTP id B34A3A022F; Thu, 6 Jun 2019 15:12:08 +0000 (UTC) Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by de02.synopsys.com (Postfix) with ESMTP id 98F4C3FED2; Thu, 6 Jun 2019 17:12:08 +0200 (CEST) From: Vitor Soares To: linux-iio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Cc: broonie@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, bbrezillon@kernel.org, Joao.Pinto@synopsys.com, lorenzo.bianconi83@gmail.com, Vitor Soares Subject: [PATCH v2 2/3] i3c: add i3c_get_device_id helper Date: Thu, 6 Jun 2019 17:12:03 +0200 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); + /** * 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) -- 2.7.4