From patchwork Tue Nov 27 00:02:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1807321 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id BB236DF2EB for ; Tue, 27 Nov 2012 00:02:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932823Ab2K0ACZ (ORCPT ); Mon, 26 Nov 2012 19:02:25 -0500 Received: from perceval.ideasonboard.com ([95.142.166.194]:48914 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932594Ab2K0ACY (ORCPT ); Mon, 26 Nov 2012 19:02:24 -0500 Received: from avalon.ideasonboard.com (unknown [91.178.20.73]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 146B735A8D; Tue, 27 Nov 2012 01:02:22 +0100 (CET) From: Laurent Pinchart To: linux-sh@vger.kernel.org Cc: Paul Mundt , Magnus Damm , Simon Horman , Linus Walleij , Kuninori Morimoto , Phil Edworthy , Nobuhiro Iwamatsu Subject: [PATCH v2 09/77] sh-pfc: Split platform device and platform driver registration Date: Tue, 27 Nov 2012 01:02:08 +0100 Message-Id: <1353974596-30033-10-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1353974596-30033-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1353974596-30033-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Move platform driver registration to a static postcore initcall. This prepares the move of platform device registration to arch code. Signed-off-by: Laurent Pinchart Acked-by: Paul Mundt --- drivers/sh/pfc/core.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/sh/pfc/core.c b/drivers/sh/pfc/core.c index f1a0c85..9736e3d 100644 --- a/drivers/sh/pfc/core.c +++ b/drivers/sh/pfc/core.c @@ -597,19 +597,16 @@ static struct platform_device sh_pfc_device = { int __init register_sh_pfc(struct sh_pfc_platform_data *pdata) { - int rc; - sh_pfc_device.dev.platform_data = pdata; - rc = platform_driver_register(&sh_pfc_driver); - if (likely(!rc)) { - rc = platform_device_register(&sh_pfc_device); - if (unlikely(rc)) - platform_driver_unregister(&sh_pfc_driver); - } + return platform_device_register(&sh_pfc_device); +} - return rc; +static int __init sh_pfc_init(void) +{ + return platform_driver_register(&sh_pfc_driver); } +postcore_initcall(sh_pfc_init); static void __exit sh_pfc_exit(void) {