From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755693Ab1K1BQJ (ORCPT ); Sun, 27 Nov 2011 20:16:09 -0500 Received: from mga03.intel.com ([143.182.124.21]:18591 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755740Ab1K1BP4 (ORCPT ); Sun, 27 Nov 2011 20:15:56 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.69,580,1315206000"; d="scan'208";a="41553720" From: Lin Ming To: Jeff Garzik , James Bottomley , Alan Stern , Tejun Heo Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Huang Ying , Zhang Rui Subject: [PATCH v4 1/6] ata: make ata port as parent device of scsi host Date: Mon, 28 Nov 2011 09:15:45 +0800 Message-Id: <1322442950-16268-2-git-send-email-ming.m.lin@intel.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1322442950-16268-1-git-send-email-ming.m.lin@intel.com> References: <1322442950-16268-1-git-send-email-ming.m.lin@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, the device tree of ata port and scsi host looks as below, /sys/devices/pci0000:00/0000:00:1f.2 (ahci controller) |-- ata1 (ata port) |-- host0 (scsi host) |-- target0:0:0 (scsi target) |-- 0:0:0:0 (disk) This patch makes ata port as parent device of scsi host, then it becomes /sys/devices/pci0000:00/0000:00:1f.2 (ahci controller) |-- ata1 (ata port) |-- host0 (scsi host) |-- target0:0:0 (scsi target) |-- 0:0:0:0 (disk) With this change, the ata port runtime PM is easier. For example, the ata port runtime suspend will happen as, disk suspend --> scsi target suspend --> scsi host suspend --> ata port suspend. Signed-off-by: Lin Ming --- drivers/ata/libata-scsi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 2a5412e..7ae1e77 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -3398,7 +3398,7 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht) */ shost->max_host_blocked = 1; - rc = scsi_add_host(ap->scsi_host, ap->host->dev); + rc = scsi_add_host(ap->scsi_host, &ap->tdev); if (rc) goto err_add; } -- 1.7.2.5