From patchwork Fri Mar 3 14:29:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 735114 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-oi0-x23b.google.com (mail-oi0-x23b.google.com [IPv6:2607:f8b0:4003:c06::23b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vZWmK0s51z9s7H for ; Sat, 4 Mar 2017 01:29:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="hj6twvtt"; dkim-atps=neutral Received: by mail-oi0-x23b.google.com with SMTP id s132sf41494651oie.1 for ; Fri, 03 Mar 2017 06:29:52 -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=ws8AKyc3TUhqw3ZCipOZ4Zu56byhF9rITr3MSrDo2WA=; b=hj6twvttjqDNDzBlSPs55HuZD0x0IycwPLbS/G4CLA4h99ioAmL3uwFzsZOZn3ESy1 W/9vMBPYN+iqX2JbYkkzbqTQbUEESSY6F6f7FkEUyqZ9uKJYGwWyeo4k0EUsjRLpWXIC BMceaxEBVv2N8A9tHjYTvQHJ9mbg8Bs2XREKaYY1hz9n0jZMSFLLmkwyTrU0Kmk1oHln va37iFvoWCFd3PSRtDjTCmGVFwhChCNnyjNEEv6UuGvYG15sQV5SPBrx1TyGX30ALE7H 26ayFnDHzeFIhvNfrnU3r9mMbrPRvyosDwnJ0Giqz2QG/9NZAAJMTcPUP0kgW8eHlV5k ioRw== 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=ws8AKyc3TUhqw3ZCipOZ4Zu56byhF9rITr3MSrDo2WA=; b=Catp/cokLEi0Z8izfpxkRZLucHHfsKESBMOcbBuNKTAxwFsr+VmWZVSjknWYRlvQGs j6umwSv9o+serdjS53cM2FrZEyMuijJU0LG8nix8nm+/yB9RazhR2Dz84Uc1DqfuaGYn CRkeVWUljP9YHJ30ASezHLiAF8MAi1ApI2Gj2w9cWqUUIpz1hrIT5exBUTX/1FEO9DyT tiP5UrYy0RvnNsjh0XTVGaYnyC/Yw7nq7sJKOrENSfZSybWv9tGLtsJntcE9EBrhujW6 eeguihWgoq44COEfAVxf1/xQd+Edr6StYlsqiSiigZuc5dSPNrMBZsnCUFTVq3MGFznZ lsxg== Sender: rtc-linux@googlegroups.com X-Gm-Message-State: AMke39lmAIu6HwxcKQr3w2AIc/YPMTyx+XnhVdvv7ZgU8y18DJBh+jJF15i/xgs5QPdXfg== X-Received: by 10.157.36.105 with SMTP id p96mr181420ota.15.1488551391342; Fri, 03 Mar 2017 06:29:51 -0800 (PST) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.157.36.169 with SMTP id z38ls2973357ota.27.gmail; Fri, 03 Mar 2017 06:29:51 -0800 (PST) X-Received: by 10.157.17.228 with SMTP id y33mr1130288oty.102.1488551391101; Fri, 03 Mar 2017 06:29:51 -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 c123si63080pfa.4.2017.03.03.06.29.51 for ; Fri, 03 Mar 2017 06:29:51 -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 F2AE6A1313; Fri, 3 Mar 2017 14:30:12 +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 i9x_j22-egqv; Fri, 3 Mar 2017 14:30:12 +0000 (UTC) Received: from minerva.sisa.samsung.com (unknown [181.121.136.80]) by osg.samsung.com (Postfix) with ESMTPSA id 708B3A0E66; Fri, 3 Mar 2017 14:30:10 +0000 (UTC) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Javier Martinez Canillas , Alexandre Belloni , rtc-linux@googlegroups.com, Alessandro Zummo Subject: [rtc-linux] [PATCH 06/13] rtc: ds3232: Add OF device ID table Date: Fri, 3 Mar 2017 11:29:17 -0300 Message-Id: <20170303142925.17915-7-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 Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , 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:. 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 --- drivers/rtc/rtc-ds3232.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c index 9bb39a06b994..deff431a37c4 100644 --- a/drivers/rtc/rtc-ds3232.c +++ b/drivers/rtc/rtc-ds3232.c @@ -442,9 +442,16 @@ static const struct i2c_device_id ds3232_id[] = { }; MODULE_DEVICE_TABLE(i2c, ds3232_id); +static const struct of_device_id ds3232_of_match[] = { + { .compatible = "dallas,ds3232" }, + { } +}; +MODULE_DEVICE_TABLE(of, ds3232_of_match); + static struct i2c_driver ds3232_driver = { .driver = { .name = "rtc-ds3232", + .of_match_table = of_match_ptr(ds3232_of_match), .pm = &ds3232_pm_ops, }, .probe = ds3232_i2c_probe,