Message ID | 20170303142925.17915-4-javier@osg.samsung.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <rtc-linux+bncBAABBV734XCQKGQEER4BS5Y@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-pg0-x239.google.com (mail-pg0-x239.google.com [IPv6:2607:f8b0:400e:c05::239]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vZWm90RYdz9s7C for <incoming@patchwork.ozlabs.org>; Sat, 4 Mar 2017 01:29:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="hgei3ZZB"; dkim-atps=neutral Received: by mail-pg0-x239.google.com with SMTP id u5sf66943855pgh.1 for <incoming@patchwork.ozlabs.org>; Fri, 03 Mar 2017 06:29:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=Vq3KO9g1nVIcEbNd2IyNEhf3FHB0vpplTITvUMS+GIQ=; b=hgei3ZZBh1ZWra5ZAGhou4LYp5Sje4dVwGi+VrrzPZhBNyUBzqM1trAcXXQbSk33p/ UYKzofzzXAjCj2LxPHxuHkSlNXDlDuk+YnV72yS+0wzxs8130XNiAQdsQcdm9hncAlqd X1JwDlShvYKDcvLKRwC8gqI/whd+3BVp1CD8lov4epqOTfEi6QLqG8zZM3bCBJWQatUz wyGTRq51WqrsXtH5cQSorLqK5Na16/kNSEytN576OAycXFpEkNKhWhZUUN3dKhpTAVxZ 8aHS4iLd1Rp63el52kPKm6DC7myEXB/7bIto18HCIPp0UhXnpIMyqCDO9V2NBIdtEUuJ omvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=Vq3KO9g1nVIcEbNd2IyNEhf3FHB0vpplTITvUMS+GIQ=; b=O9lUg6EwVD1/bWNpXqr17JS7GdHn5CK1XkTkjDjniqWc7xFx3Tj/2/sHlp+DB9T48e YdO4YdpXHOAOT8DW+X1XofHLesDd/zJhZ3OvKRT9BMscr6Xg0a9lRiMBuLgkYYfeQbnG DqR2P3HdBqf5dUKH9HU6wTZWXOmh8WYUZNTMU3/evEdb2Qe3LemWcHZqVX1+pmub9jsw ucfa7ycVhgjP3jqQEXkxjZsmEeItDa78JnlirbFYD49hJTjbVPwt4WlimU397trp+57Q mzb2O7DuyCU50yWoI9Ch6ylmdwEz9oIEk5hu7yuo8ynlK0mtBism7mzAzqn5lOwU/iaZ gyPg== Sender: rtc-linux@googlegroups.com X-Gm-Message-State: AMke39le0FLfGcfYLi+PuUKKVW5hyeAwCDvXgnaoCzhxGbRrO8Z2DCyOkgEjG2rSQi0LaQ== X-Received: by 10.157.18.133 with SMTP id g5mr183539otg.8.1488551383466; Fri, 03 Mar 2017 06:29:43 -0800 (PST) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.157.4.119 with SMTP id 110ls8836644otc.44.gmail; Fri, 03 Mar 2017 06:29:43 -0800 (PST) X-Received: by 10.157.8.97 with SMTP id 88mr1090559oty.143.1488551383257; Fri, 03 Mar 2017 06:29:43 -0800 (PST) Received: from osg.samsung.com (ec2-52-27-115-49.us-west-2.compute.amazonaws.com. [52.27.115.49]) by gmr-mx.google.com with ESMTP id r66si55896pfb.7.2017.03.03.06.29.43 for <rtc-linux@googlegroups.com>; Fri, 03 Mar 2017 06:29:43 -0800 (PST) Received-SPF: pass (google.com: domain of javier@osg.samsung.com designates 52.27.115.49 as permitted sender) client-ip=52.27.115.49; Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 241AFA12FC; Fri, 3 Mar 2017 14:30:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o6d8hw928txP; Fri, 3 Mar 2017 14:30:04 +0000 (UTC) Received: from minerva.sisa.samsung.com (unknown [181.121.136.80]) by osg.samsung.com (Postfix) with ESMTPSA id D486CA0E66; Fri, 3 Mar 2017 14:30:02 +0000 (UTC) From: Javier Martinez Canillas <javier@osg.samsung.com> To: linux-kernel@vger.kernel.org Cc: Javier Martinez Canillas <javier@osg.samsung.com>, Alexandre Belloni <alexandre.belloni@free-electrons.com>, rtc-linux@googlegroups.com, Alessandro Zummo <a.zummo@towertech.it> Subject: [rtc-linux] [PATCH 03/13] rtc: bq32k: Add OF device ID table Date: Fri, 3 Mar 2017 11:29:14 -0300 Message-Id: <20170303142925.17915-4-javier@osg.samsung.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170303142925.17915-1-javier@osg.samsung.com> References: <20170303142925.17915-1-javier@osg.samsung.com> X-Original-Sender: javier@osg.samsung.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of javier@osg.samsung.com designates 52.27.115.49 as permitted sender) smtp.mailfrom=javier@osg.samsung.com Reply-To: rtc-linux@googlegroups.com Content-Type: text/plain; charset=UTF-8 Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: <rtc-linux.googlegroups.com> X-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 List-Post: <https://groups.google.com/group/rtc-linux/post>, <mailto:rtc-linux@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:rtc-linux+help@googlegroups.com> List-Archive: <https://groups.google.com/group/rtc-linux List-Subscribe: <https://groups.google.com/group/rtc-linux/subscribe>, <mailto:rtc-linux+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+712029733259+unsubscribe@googlegroups.com>, <https://groups.google.com/group/rtc-linux/subscribe> |
diff --git a/drivers/rtc/rtc-bq32k.c b/drivers/rtc/rtc-bq32k.c index 2b223935001f..98ac8d5c7901 100644 --- a/drivers/rtc/rtc-bq32k.c +++ b/drivers/rtc/rtc-bq32k.c @@ -310,9 +310,16 @@ static const struct i2c_device_id bq32k_id[] = { }; MODULE_DEVICE_TABLE(i2c, bq32k_id); +static const struct of_device_id bq32k_of_match[] = { + { .compatible = "ti,bq32000" }, + { } +}; +MODULE_DEVICE_TABLE(of, bq32k_of_match); + static struct i2c_driver bq32k_driver = { .driver = { .name = "bq32k", + .of_match_table = of_match_ptr(bq32k_of_match), }, .probe = bq32k_probe, .remove = bq32k_remove,
The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> --- drivers/rtc/rtc-bq32k.c | 7 +++++++ 1 file changed, 7 insertions(+)