From patchwork Mon Apr 15 19:19:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitor Soares X-Patchwork-Id: 10901445 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D6FC14DB for ; Mon, 15 Apr 2019 19:20:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48006288C9 for ; Mon, 15 Apr 2019 19:20:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C1D128925; Mon, 15 Apr 2019 19:20:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE7D1288C9 for ; Mon, 15 Apr 2019 19:20:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731407AbfDOTU3 (ORCPT ); Mon, 15 Apr 2019 15:20:29 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:57364 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728289AbfDOTU2 (ORCPT ); Mon, 15 Apr 2019 15:20:28 -0400 Received: from mailhost1.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 2E75310C0B68; Mon, 15 Apr 2019 12:20:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1555356028; bh=PD9Bd2KLbPnyLJM4lKAMFHF/QND4G0ncjh4jLufAdsQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=Y96GlD/FJThumDKKCzLycHo6EZw2PPxmgEo6K/WRuNifc/MwfLwIAODGnl6L2DC/x ZKesFFTO1M127wT3eYVvCrrIuFwqHimTBzK0SCGjc9Xcx7SbzmVsfix8/mnzWcpELM Cqe1J04YvBJXRK2fH5s16Gadjsi8kHeIHEo7HImc1P3m6oMuyYwlpsHQp9hdJYaeOL 77+/jj5nG5qVq2U/hgu2W2mee9ys3tejIXu5TMt27UGXd2rT9s8XMLQcXxXqmcHwJP nKjYRp0vbGeKqUTmav/rQER5HbFLfi8wMiBHhjTnEjg4PsYFN3H/ZLAxxDUdJJ39vi KVIuoZkdjGePg== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost1.synopsys.com (Postfix) with ESMTP id 57D3F546D; Mon, 15 Apr 2019 12:19:55 -0700 (PDT) From: Vitor Soares To: linux-iio@vger.kernel.org, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Cc: 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, Vitor Soares Subject: [PATCH 2/3] i3c: Add i3c_get_device_id helper Date: Mon, 15 Apr 2019 21:19:40 +0200 Message-Id: <33ba7e13816fcece0a2f7ec917c18807359c16c7.1555354268.git.vitor.soares@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); + /** * 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)