From patchwork Fri Nov 2 07:46:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 196493 X-Patchwork-Delegate: davem@davemloft.net 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 A38322C00F3 for ; Fri, 2 Nov 2012 18:46:58 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754348Ab2KBHqz (ORCPT ); Fri, 2 Nov 2012 03:46:55 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:56817 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754179Ab2KBHqw (ORCPT ); Fri, 2 Nov 2012 03:46:52 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr4so2297937pbb.19 for ; Fri, 02 Nov 2012 00:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=dY42CuOfhvjLPqsDPN3ZuZYWDUk0Lk+bMqqzzJULAZc=; b=gmtR9WJYKs4as30wiwWQpO/sV1tpxUdM0OhR/EU8PLp2/eH4ghiZMuZmxnStClkGI5 AZ5ZdO6o9Gl0XlppMf/6H/AoamA9hkAW8C/6dRV0T9ZFmv/103ssstNPy7p4+Q+BO5km IGQHI4ecxxtDWg6QOlxAftgGND62uSbPCOFpYSPyfKMzgxkFpjnKcEkZB3vbmecNVnPX pU6KQ5ALmw/RWbS2n7L5R5fI8h4U4N5iKQ1ZE2Pi9Dsa4Qxz7PI7fWgDwg5+Ynhiiqob OHl2d7AE4PfZgOOaVEWjVooR+mgLRQzXtyONquUU3PBy2lyUNvlB+nxuoNYN9BMnaA42 ftaw== Received: by 10.68.224.9 with SMTP id qy9mr3850953pbc.3.1351842412655; Fri, 02 Nov 2012 00:46:52 -0700 (PDT) Received: from ld-irv-0074.broadcom.com (pv141010.reshsg.uci.edu. [169.234.141.10]) by mx.google.com with ESMTPS id is6sm5365133pbc.55.2012.11.02.00.46.51 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 00:46:51 -0700 (PDT) From: Brian Norris To: Jeff Garzik Cc: , Brian Norris , Tejun Heo Subject: [PATCH 01/14] ahci_platform: enable hotplug unbinding Date: Fri, 2 Nov 2012 00:46:15 -0700 Message-Id: <1351842388-27210-2-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1351842388-27210-1-git-send-email-computersforpeace@gmail.com> References: <1351842388-27210-1-git-send-email-computersforpeace@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org platform_driver_probe() should be used for registering this driver only if we want to "...remove its run-once probe() infrastructure from memory after the driver has bound to the device." However, we may want to leave the probe infrastructure in place in order to support binding/unbinding a device dynamically. This is useful, for instance, as a power management mechanism, where a device can be totally powered down when unbound (whereas with runtime power management, powering down the SATA core would incur unacceptable loss of functionality). Thus, convert this driver to use platform_driver_register(). Signed-off-by: Brian Norris --- drivers/ata/ahci_platform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index b1ae480..9bc8a78 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -75,7 +75,7 @@ static struct scsi_host_template ahci_platform_sht = { AHCI_SHT("ahci_platform"), }; -static int __init ahci_probe(struct platform_device *pdev) +static int __devinit ahci_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ahci_platform_data *pdata = dev_get_platdata(dev); @@ -326,6 +326,7 @@ static const struct of_device_id ahci_of_match[] = { MODULE_DEVICE_TABLE(of, ahci_of_match); static struct platform_driver ahci_driver = { + .probe = ahci_probe, .remove = __devexit_p(ahci_remove), .driver = { .name = "ahci", @@ -338,7 +339,7 @@ static struct platform_driver ahci_driver = { static int __init ahci_init(void) { - return platform_driver_probe(&ahci_driver, ahci_probe); + return platform_driver_register(&ahci_driver); } module_init(ahci_init);