From patchwork Thu Apr 3 03:44:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 336498 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E7ED5140142 for ; Thu, 3 Apr 2014 14:45:00 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758868AbaDCDo5 (ORCPT ); Wed, 2 Apr 2014 23:44:57 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:22630 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758860AbaDCDo5 (ORCPT ); Wed, 2 Apr 2014 23:44:57 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N3F00I6CRQVYP50@mailout4.samsung.com> for linux-pwm@vger.kernel.org; Thu, 03 Apr 2014 12:44:55 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.50]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id B2.F7.14803.739DC335; Thu, 03 Apr 2014 12:44:55 +0900 (KST) X-AuditID: cbfee691-b7efc6d0000039d3-b6-533cd9372e83 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 8A.A9.29263.739DC335; Thu, 03 Apr 2014 12:44:55 +0900 (KST) Received: from DOJG1HAN03 ([12.36.166.146]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N3F00MAFRQUZR60@mmp2.samsung.com>; Thu, 03 Apr 2014 12:44:54 +0900 (KST) From: Jingoo Han To: 'Thierry Reding' Cc: linux-pwm@vger.kernel.org, 'Jingoo Han' , 'Eric Miao' Subject: [PATCH v2] pwm: pxa: Use of_match_ptr() Date: Thu, 03 Apr 2014 12:44:54 +0900 Message-id: <000d01cf4eef$13881770$3a984650$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac9O7xN0yYTaSTnsTyaz68s2ymrPSw== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHIsWRmVeSWpSXmKPExsVy+t8zI13zmzbBBjNPS1jsaDvOZnF54SVW i7t3VzFa/Nw1j8WBxWPnrLvsHn1bVjF6fN4kF8AcxWWTkpqTWZZapG+XwJVxaoZZwUfOiuNz vBoYmzm6GDk5JARMJGZ0PWaGsMUkLtxbz9bFyMUhJLCMUWLt+uNMMEU7nrSzQySmM0rc61jJ COH8ZpR4u2caK0gVm4CaxJcvh9lBbBEBfYlL1y+BxZkFMiRa9+xgAbGFBQwk2k7cAIuzCKhK TNzdBlbPK2Ar8a3zJJQtKPFj8j0WiF4tifU7Ia5gFpCX2LzmLdCpHEAXqUs8+qsLsUpPYl/r OkaIEhGJfS/eMUIcvYxdonMz1CoBiW+TD7FAtMpKbDoA9bCkxMEVN1gmMIrNQrJ4FpLFs5As noVkwwJGllWMoqkFyQXFSelFpnrFibnFpXnpesn5uZsYIXE1cQfj/QPWhxiTgdZPZJYSTc4H xmVeSbyhsZmRhamJqbGRuaUZacJK4rzpj5KChATSE0tSs1NTC1KL4otKc1KLDzEycXBKNTCK GO8ycuyyDNmw//GFKQvj+vNtetbxbnnWVzEvvnuGTUdW+eWHcjHtc268yaq4rhz/Jna6U/z8 I494PNi6NxxO3bzWmfezNMv1hQFZjeXBX8QrnaUsVnKnnP999fRlrZaQOfwZzrN+7evd8eDv Qd5vKtwXVotNUJN9r6R9gXXLhJhfCss3NvcosRRnJBpqMRcVJwIAqKkQjMECAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42I5/e+xoK75TZtgg83fRCx2tB1ns7i88BKr xd27qxgtfu6ax+LA4rFz1l12j74tqxg9Pm+SC2COamC0yUhNTEktUkjNS85PycxLt1XyDo53 jjc1MzDUNbS0MFdSyEvMTbVVcvEJ0HXLzAFap6RQlphTChQKSCwuVtK3wzQhNMRN1wKmMULX NyQIrsfIAA0krGPMODXDrOAjZ8XxOV4NjM0cXYycHBICJhI7nrSzQ9hiEhfurWfrYuTiEBKY zihxr2MlI4Tzm1Hi7Z5prCBVbAJqEl++HAbrEBHQl7h0/RJYnFkgQ6J1zw4WEFtYwECi7cQN sDiLgKrExN1tYPW8ArYS3zpPQtmCEj8m32OB6NWSWL/zOBOELS+xec1b5i5GDqCL1CUe/dWF WKUnsa91HSNEiYjEvhfvGCcwCsxCMmkWkkmzkEyahaRlASPLKkbR1ILkguKk9FxDveLE3OLS vHS95PzcTYzguH0mtYNxZYPFIUYBDkYlHl4LKZtgIdbEsuLK3EOMEhzMSiK8LvuAQrwpiZVV qUX58UWlOanFhxiTgR6dyCwlmpwPTCl5JfGGxiZmRpZGZhZGJubmpAkrifMeaLUOFBJITyxJ zU5NLUgtgtnCxMEp1cCoa1j9am34mXsPZ8V8M55rNj2DLaIlQfdzQ8oejwmLBLWm3xHzr9sY 63z+re+Cc3tMe9fMmP73++/W8wc3nGO7EvRcMd9pSlYe66MQ8yW+28+VHf6btS5Bs9i47HVI X82cWVczc496HvD7b3P83ZbXGzve3BJyDe68f1I5u0SuSnVyYYlCxL6ZSizFGYmGWsxFxYkA hr4txB8DAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-pwm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org Use of_match_ptr(), because of_match_ptr() returns NULL pointer when CONFIG_OF is disabled. Signed-off-by: Jingoo Han --- Changes since v1: - Add of_match_ptr() to of_match_device() in order to fix compile error when CONFIG_OF=n. drivers/pwm/pwm-pxa.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c index cd356d8..024e6a4 100644 --- a/drivers/pwm/pwm-pxa.c +++ b/drivers/pwm/pwm-pxa.c @@ -140,14 +140,13 @@ static const struct of_device_id pwm_of_match[] = { { } }; MODULE_DEVICE_TABLE(of, pwm_of_match); -#else -#define pwm_of_match NULL #endif static const struct platform_device_id *pxa_pwm_get_id_dt(struct device *dev) { - const struct of_device_id *id = of_match_device(pwm_of_match, dev); + const struct of_device_id *id; + id = of_match_device(of_match_ptr(pwm_of_match), dev); return id ? id->data : NULL; } @@ -228,7 +227,7 @@ static struct platform_driver pwm_driver = { .driver = { .name = "pxa25x-pwm", .owner = THIS_MODULE, - .of_match_table = pwm_of_match, + .of_match_table = of_match_ptr(pwm_of_match), }, .probe = pwm_probe, .remove = pwm_remove,