From patchwork Mon Jun 11 15:24:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 9194 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5436D23EB4 for ; Mon, 11 Jun 2012 15:25:25 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 2457CA186A7 for ; Mon, 11 Jun 2012 15:25:25 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so2858474yhp.11 for ; Mon, 11 Jun 2012 08:25:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=v5w0pe+h7Z0NKsFp6ytlgCQBhWUO9tmb/cOSVSHiqGU=; b=ols2m5h5akBX89yxLyLrroUPV7Okn6qgOOHaLrjyUV1k9MxROzUp6Hguua3IZRLZk5 Ecy3/j3ChSdHdqqtbokoNGRjNzU/IBWtVgIFl9nerZtTM/am7H7ltTA9awdd+mdiqs6Z Do7ERTv88WkIYUJu43axx0nbFnNiLCgISndHxdGtSYEm3J5Zk1zKCoMzOu1YGJUHulRd BDNzBfbKX69UeIzzZ63uVQD/tC6nZIneI8r7mLcUwxtFlcBDCDt0V6aMp3dQtRTHAXBF /tJ1nSc9qtyA/MkyW76TQWOfERTolJntQ7bkzwhClf59+GM8pKcpW5dqQOie6MICvTnZ fRmQ== Received: by 10.50.163.99 with SMTP id yh3mr6494867igb.53.1339428324578; Mon, 11 Jun 2012 08:25:24 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp115712ibb; Mon, 11 Jun 2012 08:25:23 -0700 (PDT) Received: by 10.180.100.2 with SMTP id eu2mr21748862wib.10.1339428323044; Mon, 11 Jun 2012 08:25:23 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id eu2si16955643wib.8.2012.06.11.08.25.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jun 2012 08:25:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by wibhn6 with SMTP id hn6so2491211wib.13 for ; Mon, 11 Jun 2012 08:25:22 -0700 (PDT) Received: by 10.180.83.197 with SMTP id s5mr21790466wiy.9.1339428322429; Mon, 11 Jun 2012 08:25:22 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id ch9sm39413606wib.8.2012.06.11.08.25.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jun 2012 08:25:21 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linus.walleij@stericsson.com, arnd@arndb.de, grant.likely@secretlab.ca, Lee Jones , Alessandro Zummo , rtc-linux@googlegroups.com Subject: [PATCH 02/14] rtc: Ensure correct probing of the AB8500 RTC when Device Tree is enabled Date: Mon, 11 Jun 2012 16:24:55 +0100 Message-Id: <1339428307-3850-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1339428307-3850-1-git-send-email-lee.jones@linaro.org> References: <1339428307-3850-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmWceS6I7EWTWsJjg5duCYlQIYYBO++slQYvVzCBfwtw0XleILnC9R6ITZha7f03Npe0uVb Without this patch, if Device Tree is enabled the AB8500 RTC wouldn't get probed at all, as there is no reference to it from platform code. This patch ensures the driver is probed during normal DT start-up. Cc: Alessandro Zummo Cc: rtc-linux@googlegroups.com Signed-off-by: Lee Jones --- drivers/rtc/rtc-ab8500.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c index b11a2ec..116c23d 100644 --- a/drivers/rtc/rtc-ab8500.c +++ b/drivers/rtc/rtc-ab8500.c @@ -17,6 +17,7 @@ #include #include #include +#include #define AB8500_RTC_SOFF_STAT_REG 0x00 #define AB8500_RTC_CC_CONF_REG 0x01 @@ -430,7 +431,6 @@ static int __devinit ab8500_rtc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, rtc); - err = ab8500_sysfs_rtc_register(&pdev->dev); if (err) { dev_err(&pdev->dev, "sysfs RTC failed to register\n"); @@ -454,10 +454,16 @@ static int __devexit ab8500_rtc_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id ab8500_rtc_match[] = { + { .compatible = "stericsson,ab8500-rtc", }, + {} +}; + static struct platform_driver ab8500_rtc_driver = { .driver = { .name = "ab8500-rtc", .owner = THIS_MODULE, + .of_match_table = ab8500_rtc_match, }, .probe = ab8500_rtc_probe, .remove = __devexit_p(ab8500_rtc_remove),