From patchwork Mon Apr 1 00:21:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 2368841 Return-Path: X-Original-To: patchwork-linux-acpi@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 256B53FC8C for ; Mon, 1 Apr 2013 00:13:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756192Ab3DAANg (ORCPT ); Sun, 31 Mar 2013 20:13:36 -0400 Received: from hydra.sisk.pl ([212.160.235.94]:49019 "EHLO hydra.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756188Ab3DAANf (ORCPT ); Sun, 31 Mar 2013 20:13:35 -0400 Received: from vostro.rjw.lan (aepo243.neoplus.adsl.tpnet.pl [79.191.144.243]) by hydra.sisk.pl (Postfix) with ESMTPSA id BEC3AE3F21; Mon, 1 Apr 2013 02:12:11 +0200 (CEST) From: "Rafael J. Wysocki" To: ACPI Devel Maling List Cc: LKML , Mika Westerberg , grant.likely@secretlab.ca, broonie@opensource.wolfsonmicro.com Subject: [PATCH] ACPI / SPI: Use parent's ACPI_HANDLE() in acpi_register_spi_devices() Date: Mon, 01 Apr 2013 02:21:08 +0200 Message-ID: <2747891.0orCNBJG8v@vostro.rjw.lan> User-Agent: KMail/4.9.5 (Linux/3.9.0-rc4+; KDE/4.9.5; x86_64; ; ) MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Rafael J. Wysocki The ACPI handle of struct spi_master's dev member should not be set, because this causes that struct spi_master to be associated with the ACPI device node corresponding to its parent as the second "physical_device", which is incorrect (this happens during the registration of struct spi_master). Consequently, acpi_register_spi_devices() should use the ACPI handle of the parent of the struct spi_master it is called for rather than that struct spi_master's ACPI handle (which should be NULL). Make that happen and modify the spi-pxa2xx driver, which currently is the only driver for ACPI-enumerated SPI controller chips, not to set the ACPI handle for the struct spi_master it creates. Signed-off-by: Rafael J. Wysocki Acked-by: Mika Westerberg Acked-by: Mark Brown --- drivers/spi/spi-pxa2xx.c | 1 - drivers/spi/spi.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-pm/drivers/spi/spi.c =================================================================== --- linux-pm.orig/drivers/spi/spi.c +++ linux-pm/drivers/spi/spi.c @@ -984,7 +984,7 @@ static void acpi_register_spi_devices(st acpi_status status; acpi_handle handle; - handle = ACPI_HANDLE(&master->dev); + handle = ACPI_HANDLE(master->dev.parent); if (!handle) return; Index: linux-pm/drivers/spi/spi-pxa2xx.c =================================================================== --- linux-pm.orig/drivers/spi/spi-pxa2xx.c +++ linux-pm/drivers/spi/spi-pxa2xx.c @@ -1168,7 +1168,6 @@ static int pxa2xx_spi_probe(struct platf master->dev.parent = &pdev->dev; master->dev.of_node = pdev->dev.of_node; - ACPI_HANDLE_SET(&master->dev, ACPI_HANDLE(&pdev->dev)); /* the spi->mode bits understood by this driver: */ master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP;