From patchwork Thu Dec 20 11:25:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13673 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 227E823E1F for ; Thu, 20 Dec 2012 11:33:25 +0000 (UTC) Received: from mail-ie0-f171.google.com (mail-ie0-f171.google.com [209.85.223.171]) by fiordland.canonical.com (Postfix) with ESMTP id A634BA185B3 for ; Thu, 20 Dec 2012 11:33:24 +0000 (UTC) Received: by mail-ie0-f171.google.com with SMTP id 17so4347797iea.2 for ; Thu, 20 Dec 2012 03:33:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=hIKZKI2uNCEMFdnhFwnCUJLYwvpUrAIf4P/RHpSeLYA=; b=Oh7Y2LF5TjLPrYpaS+uS+I4089LoieDjbrkp/bsuGkWgUs6l+140wmYetflJjLfuai Fgfj2nUgtOWmMYaHgYXEfWtTuKDu4Fn24TLO2qJg71q5AEuHd2s2Kand94eCBDzXDO37 UKmbtvpSgl8j1VgF7ZYxGAe9ljRC14R1K3GzxNN9U7P0TFS/xoalNXJbFpukndVf05Iv j3xCFwaaZAP4cBHQo5TRtIht5d5nZ1cJekn8b9LksCHmT5m+YR2GYRy1R5UXkqYZj7Yn YzfKPQvcMZ4NW8ZqxnMUYZ/cNMap52yxzb7HB0Gugdn/N2zYMbsssBSe27BahMORdi+G Vp5A== X-Received: by 10.43.92.72 with SMTP id bp8mr8619705icc.49.1356003204112; Thu, 20 Dec 2012 03:33:24 -0800 (PST) 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.50.67.115 with SMTP id m19csp21993igt; Thu, 20 Dec 2012 03:33:23 -0800 (PST) X-Received: by 10.68.192.74 with SMTP id he10mr28063435pbc.147.1356003202699; Thu, 20 Dec 2012 03:33:22 -0800 (PST) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx.google.com with ESMTPS id y1si8628409pav.103.2012.12.20.03.33.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Dec 2012 03:33:22 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.46; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pa0-f46.google.com with SMTP id bh2so2024064pad.19 for ; Thu, 20 Dec 2012 03:33:22 -0800 (PST) X-Received: by 10.68.252.4 with SMTP id zo4mr28828146pbc.126.1356003202319; Thu, 20 Dec 2012 03:33:22 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id vx2sm4911874pbc.33.2012.12.20.03.33.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Dec 2012 03:33:21 -0800 (PST) From: Sachin Kamat To: rtc-linux@googlegroups.com Cc: akpm@linux-foundation.org, sachin.kamat@linaro.org, patches@linaro.org, Alessandro Zummo Subject: [PATCH 1/1] drivers/rtc: Use of_match_ptr() macro Date: Thu, 20 Dec 2012 16:55:55 +0530 Message-Id: <1356002755-26627-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQkbKNLZ5qmYhbCnDX61RmMdFtw1ZN+N9LBaTsHfZjmF10U3qbugK0+XfsmyMLi8wq15CVvt This eliminates having an #ifdef returning NULL for the case when OF is disabled. Maintains consistency in cases where OF is always selected. Signed-off-by: Sachin Kamat Cc: Alessandro Zummo --- Compile tested all except rtc-mpc5121.c using linux-next tree (20121220). --- drivers/rtc/rtc-mpc5121.c | 5 ++++- drivers/rtc/rtc-sa1100.c | 4 +++- drivers/rtc/rtc-snvs.c | 2 +- drivers/rtc/rtc-stmp3xxx.c | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-mpc5121.c b/drivers/rtc/rtc-mpc5121.c index 029e421..6181a2f 100644 --- a/drivers/rtc/rtc-mpc5121.c +++ b/drivers/rtc/rtc-mpc5121.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -403,17 +404,19 @@ static int __devexit mpc5121_rtc_remove(struct platform_device *op) return 0; } +#ifdef CONFIG_OF static struct of_device_id mpc5121_rtc_match[] __devinitdata = { { .compatible = "fsl,mpc5121-rtc", }, { .compatible = "fsl,mpc5200-rtc", }, {}, }; +#endif static struct platform_driver mpc5121_rtc_driver = { .driver = { .name = "mpc5121-rtc", .owner = THIS_MODULE, - .of_match_table = mpc5121_rtc_match, + .of_match_table = of_match_ptr(mpc5121_rtc_match), }, .probe = mpc5121_rtc_probe, .remove = __devexit_p(mpc5121_rtc_remove), diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c index 50a5c4a..df9180e 100644 --- a/drivers/rtc/rtc-sa1100.c +++ b/drivers/rtc/rtc-sa1100.c @@ -349,12 +349,14 @@ static const struct dev_pm_ops sa1100_rtc_pm_ops = { }; #endif +#ifdef CONFIG_OF static struct of_device_id sa1100_rtc_dt_ids[] = { { .compatible = "mrvl,sa1100-rtc", }, { .compatible = "mrvl,mmp-rtc", }, {} }; MODULE_DEVICE_TABLE(of, sa1100_rtc_dt_ids); +#endif static struct platform_driver sa1100_rtc_driver = { .probe = sa1100_rtc_probe, @@ -364,7 +366,7 @@ static struct platform_driver sa1100_rtc_driver = { #ifdef CONFIG_PM .pm = &sa1100_rtc_pm_ops, #endif - .of_match_table = sa1100_rtc_dt_ids, + .of_match_table = of_match_ptr(sa1100_rtc_dt_ids), }, }; diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c index 3c0da33..7cb809c 100644 --- a/drivers/rtc/rtc-snvs.c +++ b/drivers/rtc/rtc-snvs.c @@ -338,7 +338,7 @@ static struct platform_driver snvs_rtc_driver = { .name = "snvs_rtc", .owner = THIS_MODULE, .pm = &snvs_rtc_pm_ops, - .of_match_table = snvs_dt_ids, + .of_match_table = of_match_ptr(snvs_dt_ids), }, .probe = snvs_rtc_probe, .remove = __devexit_p(snvs_rtc_remove), diff --git a/drivers/rtc/rtc-stmp3xxx.c b/drivers/rtc/rtc-stmp3xxx.c index 739ef556..b2a8ed9 100644 --- a/drivers/rtc/rtc-stmp3xxx.c +++ b/drivers/rtc/rtc-stmp3xxx.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -280,7 +281,7 @@ static struct platform_driver stmp3xxx_rtcdrv = { .driver = { .name = "stmp3xxx-rtc", .owner = THIS_MODULE, - .of_match_table = rtc_dt_ids, + .of_match_table = of_match_ptr(rtc_dt_ids), }, };