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: 10902745 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 2C216161F for ; Tue, 16 Apr 2019 11:12:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 094E12898D for ; Tue, 16 Apr 2019 11:12:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F128B289B7; Tue, 16 Apr 2019 11:12:28 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2E0592898D for ; Tue, 16 Apr 2019 11:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=IjOdWiwDK3bt3icdUTVr5EjqgfM+9Lck+OE0fiunz4o=; b=LWRlDKgdfNMP2KjCZgK4jevLeD Q810kKpCvkV4F07Q5M7yBMY3X6LNlTMZXD5G2LMVPtZcmGwK0l207Sstoa5gaNH17Z7pmtbUa15PJ hkUMB+Ue2ZoPfiyDcgI42SJ13rZeX+kRC1vbMYRWsELlc1XfP+p7J1wGlQQO40WybBgG+21EO5AKY JoZIlgH8kRhGw+cXNrWcVJXAGLzvbHGkQBaD6dcvXKDw5Cwf5quBhLIZqf1NaAzv1fIC3i8U4aiW9 FMuOwUUTVfBhyoNfEABxghPhCRLEfj2Ht0C7kNlnmwsLQNKQXmaPgsEHf2do5LF/8GVHM5d2DpR8e s+T9P4cw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGM0p-0001FG-KW; Tue, 16 Apr 2019 11:12:27 +0000 Received: from smtprelay.synopsys.com ([198.182.60.111]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hG79Y-0001Qu-9E for linux-i3c@lists.infradead.org; Mon, 15 Apr 2019 19:20:29 +0000 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 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190415_122028_323863_A150D26C X-CRM114-Status: UNSURE ( 9.42 ) X-CRM114-Notice: Please train this message. X-Mailman-Approved-At: Tue, 16 Apr 2019 04:12:27 -0700 X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux I3C List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lars@metafoo.de, bbrezillon@kernel.org, gregkh@linuxfoundation.org, joao.pinto@synopsys.com, rafael@kernel.org, Vitor Soares , broonie@kernel.org, pmeerw@pmeerw.net, knaack.h@gmx.de, lorenzo.bianconi83@gmail.com, jic23@kernel.org MIME-Version: 1.0 Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=patchwork.kernel.org@lists.infradead.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)