From patchwork Wed Nov 21 02:53:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1777491 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 7A6F93FD1A for ; Wed, 21 Nov 2012 02:53:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754477Ab2KUCxY (ORCPT ); Tue, 20 Nov 2012 21:53:24 -0500 Received: from perceval.ideasonboard.com ([95.142.166.194]:39405 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754147Ab2KUCxY (ORCPT ); Tue, 20 Nov 2012 21:53:24 -0500 Received: from avalon.ideasonboard.com (unknown [91.178.91.187]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7768235A8B for ; Wed, 21 Nov 2012 03:53:21 +0100 (CET) From: Laurent Pinchart To: linux-sh@vger.kernel.org Subject: [PATCH 09/42] sh-pfc: Split platform device and platform driver registration Date: Wed, 21 Nov 2012 03:53:25 +0100 Message-Id: <1353466438-10929-10-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1353466438-10929-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1353464863-10281-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> <1353466438-10929-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 --- 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) {