From patchwork Wed Nov 23 08:55:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolae Rosia X-Patchwork-Id: 698105 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-vk0-x240.google.com (mail-vk0-x240.google.com [IPv6:2607:f8b0:400c:c05::240]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tNx5V6f61z9t2n for ; Wed, 23 Nov 2016 19:56:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="GQk+oNlo"; dkim-atps=neutral Received: by mail-vk0-x240.google.com with SMTP id p9sf2147852vkd.1 for ; Wed, 23 Nov 2016 00:56:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version: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=zMA1ce7KbJkr8G8Ea1gQJ5Uk0JYZupiC7IyULk8Q5bk=; b=GQk+oNlocPLn3o9fzb9N0qoItk0LObPdpacNuVsgi7BtFguWqIcuIQZN5pAJ5Xz3Vc CIIeN42OgWfrh9yZLhbFXuZ52pr6hGquGtkpszhOE1zScpJ/fL/HdM+m23aiNmq/YviS NV2l1dKjNWaa+VhJZ9M3TrC3cEbxc21TBIWCvEAdL4VFtCZIENSd5i2S+UxLUktvaQRA /rb7Blx3QKLH4TCOGlnGHM0hT5gSsXX4lFNpbII7WAnvB6FkC07uRHhyezaeeBp9oAl5 D78hFueF+x6anF9/Ogy9xspBbh1xPXQwUzbQqH/oK3ln3F0NBzkj44/UrOEX/RoMDvQD lgjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version: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=zMA1ce7KbJkr8G8Ea1gQJ5Uk0JYZupiC7IyULk8Q5bk=; b=T+jsZvKxZin9RQ0tyUKEYsS+OFHiMKkMAUEQkKxA6qMLOrPe9sg5/YK1gEdxDaas3L HTynDkZWfEpXvgONVtGdNr91ctjGD0mxizbkaW5iZyAVQnm4KEKqlgZJdoouWE49vHhj lacEAaQar80VF96+MqCQ3aWDkxUZKcpOX2RaazQ0C59+v2QXu0mi6pAVSbJElcOQa3J5 T+eyiJpNsXAiC1qc2j6n46BRUE5f1caFR3AFs82w7b9UvtaEEU1/wcNqGEUAw5y7i/G0 OKbOPSnCGJWWnTHs8bZ4mpdVjxy17XazxC2jOpBvbXvdTBX5IDR2y5QDpY3LJI0h7UPp 0Iig== Sender: rtc-linux@googlegroups.com X-Gm-Message-State: AKaTC01L+bcHEo4yw8texaJx+vhA8n10UelWcyuORkXnAiAI8xXA7kHfexI68aegLCQdZA== X-Received: by 10.157.45.170 with SMTP id g39mr131859otb.16.1479891372902; Wed, 23 Nov 2016 00:56:12 -0800 (PST) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.157.59.227 with SMTP id k90ls828497otc.8.gmail; Wed, 23 Nov 2016 00:56:12 -0800 (PST) X-Received: by 10.13.206.193 with SMTP id q184mr499442ywd.87.1479891372675; Wed, 23 Nov 2016 00:56:12 -0800 (PST) Received: from relay1.mentorg.com (relay1.mentorg.com. [192.94.38.131]) by gmr-mx.google.com with ESMTPS id g192si588166pfb.1.2016.11.23.00.56.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Nov 2016 00:56:12 -0800 (PST) Received-SPF: pass (google.com: domain of nicolae_rosia@mentor.com designates 192.94.38.131 as permitted sender) client-ip=192.94.38.131; Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1c9TLg-0006BC-79 from Nicolae_Rosia@mentor.com ; Wed, 23 Nov 2016 00:56:12 -0800 Received: from rosia.mgc (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Wed, 23 Nov 2016 08:56:11 +0000 From: Nicolae Rosia To: Alexandre Belloni CC: Alessandro Zummo , , , Tony Lindgren , Nicolae Rosia Subject: [rtc-linux] [PATCH v2 2/2] rtc: rtc-twl: make driver DT only Date: Wed, 23 Nov 2016 10:55:57 +0200 Message-ID: <20161123085557.5656-3-Nicolae_Rosia@mentor.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161123085557.5656-1-Nicolae_Rosia@mentor.com> References: <20161123085557.5656-1-Nicolae_Rosia@mentor.com> MIME-Version: 1.0 X-Original-Sender: nicolae_rosia@mentor.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of nicolae_rosia@mentor.com designates 192.94.38.131 as permitted sender) smtp.mailfrom=Nicolae_Rosia@mentor.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: , Since there are no platform based users and all users of this code are TI OMAP-based which is DT only, it makes sense to remove unused code. Signed-off-by: Nicolae Rosia --- drivers/rtc/Kconfig | 1 + drivers/rtc/rtc-twl.c | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index e859d14..2189216 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -481,6 +481,7 @@ config RTC_DRV_TWL92330 config RTC_DRV_TWL4030 tristate "TI TWL4030/TWL5030/TWL6030/TPS659x0" depends on TWL4030_CORE + depends on OF help If you say yes here you get support for the RTC on the TWL4030/TWL5030/TWL6030 family chips, used mostly with OMAP3 platforms. diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c index 1e41526..c18c392 100644 --- a/drivers/rtc/rtc-twl.c +++ b/drivers/rtc/rtc-twl.c @@ -496,10 +496,16 @@ static const struct rtc_class_ops twl_rtc_ops = { static int twl_rtc_probe(struct platform_device *pdev) { struct twl_rtc *twl_rtc; + struct device_node *np = pdev->dev.of_node; int ret = -EINVAL; int irq = platform_get_irq(pdev, 0); u8 rd_reg; + if (!np) { + dev_err(&pdev->dev, "no DT info\n"); + return -EINVAL; + } + if (irq <= 0) return ret; @@ -632,15 +638,11 @@ static int twl_rtc_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(twl_rtc_pm_ops, twl_rtc_suspend, twl_rtc_resume); -#ifdef CONFIG_OF static const struct of_device_id twl_rtc_of_match[] = { {.compatible = "ti,twl4030-rtc", }, { }, }; MODULE_DEVICE_TABLE(of, twl_rtc_of_match); -#endif - -MODULE_ALIAS("platform:twl_rtc"); static struct platform_driver twl4030rtc_driver = { .probe = twl_rtc_probe, @@ -649,7 +651,7 @@ static struct platform_driver twl4030rtc_driver = { .driver = { .name = "twl_rtc", .pm = &twl_rtc_pm_ops, - .of_match_table = of_match_ptr(twl_rtc_of_match), + .of_match_table = twl_rtc_of_match, }, };