Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2523853yba; Mon, 15 Apr 2019 13:32:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpmTW/BN1zIn4C7W82JSpt6xSEiGo9/ZokX6+F8ID477icxJQDoAktZHhqvIzV5k/DIXtI X-Received: by 2002:a62:8381:: with SMTP id h123mr78562664pfe.226.1555360353443; Mon, 15 Apr 2019 13:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555360353; cv=none; d=google.com; s=arc-20160816; b=LLkvuSdfZyb0V5vKKnzVEblDJuc1lU15BfY/dlIf433TIM7NCoozSbsLd5yEbTW8uA 9w/7NAq4LzHUjo9e/6q6yrY/dBePzVC2VwXekkkCItvWkvbq3bEbGOeZQlM3L/QJ/8ua pOCFdDi0MR21Eto821gPNGmXH34DFq6mzPeNOFC+EkMkQEcEiAd/9qMR7X9q9fk1z8NB fvR83ANJVkvMB8PYqaQQpC30m7RINqenrtyZ/RR76pbhnc1iQK+mPwKYbKDDJAoMHU0+ IJpi6LD19/A5m7SIcQwVjEdU3Qw/dWxkvKiYw3WwYnX4n82MWUe2gn+P68C9JR1uhil7 yyFw== 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=scCdK4r1cZHf7jrUcfFm2mkigi+ibwcLPfn/ykP7YPU=; b=BBgmYWmGdJwu4kLUsZXtmO3EovtIUQrD627mPeJok/4I8VsbWqz9tnuhrbHKlxBpOc 0gDmPdlZhKpyvJ1rdpjG23cxwg63MpYKEHxH+FxdjUaRHko0G1M8cKXAJzccmbKpbBn3 OoWAUz7EZ2UfzAk51S60tZq1obJnPIC4DX0j0FrdQf6XiS4Jei4zohmKeyjnOyBmtJX4 RIAFStjR4DsfSIBRsOSf6AdUEezM3mQVmIxpuqWYGhXof+qZ8ecWOfoWLGI66Iev7T35 G/4XgzSltXgnyxNdy52gm3kVmz2PAu/jSOtfRvEs/vNfiCaSDvOZatInMSlOXFr8q1A+ gR+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b="Y96GlD/F"; 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 z8si44250424pgu.217.2019.04.15.13.32.16; Mon, 15 Apr 2019 13:32:33 -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="Y96GlD/F"; 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 S1731620AbfDOTUa (ORCPT + 99 others); Mon, 15 Apr 2019 15:20:30 -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-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 --- 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) -- 2.7.4