Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5542420pxb; Wed, 26 Jan 2022 14:35:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzP7WmdRVczbdOpqiUVMyzfOkKDyPhCYqQ2ffRz94qjQvygREJZKUlFQx2mYINzfbSg8jbN X-Received: by 2002:aa7:da81:: with SMTP id q1mr1028292eds.25.1643236550271; Wed, 26 Jan 2022 14:35:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643236550; cv=none; d=google.com; s=arc-20160816; b=J5TBxWWacK9ZM38mqGfqLC8gYTVxVJ3YrBFt0TNsCMu4Aed0/e+/NkvnpxJuL4/7JJ v409WWJO3tLHDBmCUG9LeYjXZ9xCIunqMO+uxl9mVV7C4x5h5Y5Vvi55w1Qs/5ezxJ4/ UNlzL1WJUhfyczWkjgGPrEE2WLUzC9+jhvdgPOENfzojrxBVb358K01HX40PYZ3vhr98 WM9n1o+DkF6zQD0A+4N3UJ8NJFJ1pq3AsSIy3fIgr3zdt0UHwiuIUPk60RRwDbz9mgxK YIYrSI6IhCLBEfcSLiIMF4P4lKC3K4JgCvI8lPRBh1e1+K4oNZLW1q8Cfd3zkiuWizFL 5/JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mY3ysCNj443GJifLQmlNddA04KgyJaSyoL9/oKRXsTM=; b=f0pka2e4O9weVRG5geWwBGdD8v6ZHw7qKsfFtf0/xAX2AQu9ON7G5kpZnzCTa2Vdxp sFOKjFo5iatAONchXsuhmpZhQnVxwmrnyrbA7H2C8QnamDY24fGhFqSDfzqpJdn+K462 b0fQbA3am8pZrSaupgTEwyxG1qmGR/MEnu+DrkCV3z3IY3hurK6re6Pe1IzKuJJ1l9X2 7pbZ8OTmnBV0/Gpuc7ysaWkHb9HGzhn2p4OL2CFmmBuQii54jXgn2ls0tzXWmuVv8cZA KcltgAMKdDbmiMVgqzUU/8kSfdc5a/ljs4IMh6VtufdG+NiyMgLmxOHIsxZsBqmK0G0c fsmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pDcaBROW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si262087edq.254.2022.01.26.14.35.25; Wed, 26 Jan 2022 14:35:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pDcaBROW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229632AbiAZUDc (ORCPT + 99 others); Wed, 26 Jan 2022 15:03:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbiAZUDb (ORCPT ); Wed, 26 Jan 2022 15:03:31 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 843DAC06161C; Wed, 26 Jan 2022 12:03:31 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id n12-20020a05600c3b8c00b0034eb13edb8eso2389582wms.0; Wed, 26 Jan 2022 12:03:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=mY3ysCNj443GJifLQmlNddA04KgyJaSyoL9/oKRXsTM=; b=pDcaBROWSVIDle6By0jiJSiVP0Hu76DXRnUxeAG0T5nKk4QJ8IhhyUwIuEpEMvny9g 3DXcsm7g+qBzy4g263s0CEH5Q0buBZTaQgrFmFy40OBybi5OJ0jWuhlyjEfidxkhyPJw fm08fQpPqgHgWuxiluTqkQp27i9B/6qkTfEUZ+IDc7wvuu4rY0pv0+Yw4nzYZ/pSOfRn oPMR0uaXGLqOXN97wTE1d6NWh/wKy9dzqPEpWQCQWSN6zUoSoag8uS4UyTSsB7pGsljy jfw8Hnq9IRW9Lad37EpCihHmwZAUzt3Tp3vWjoX9AmN7ysggXIrqTLyqSN8D3cQDzPLA XLBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=mY3ysCNj443GJifLQmlNddA04KgyJaSyoL9/oKRXsTM=; b=3mnHWfKBvGhRjbN0i2qQWZLCh/QJry/YAIOseykXZ9mghWSHFkDOi2rr/IyY2E+CdB qKg6flBg3OrLr78XqfBn/4gBQscLIMQZaSKQbJUdZkeKRGh5Irj+b/v8/LSZp6s7YM4D zu3VkQC9GhWvAMror4xnNAO+WXFjeUdWqXXg2rKa4mCQ0xerCM9PnEeeJcBnUFdyXvDy 1n/yqky/SydrHGfBT2BKSCTy9rX2YRDlmMvO4Jy7EggWstxwDZalZ0vFmM8B57tql9BA 9t8Sx7OltGe2HX0ORuC2YNHN4k5LRHC46lb2hLMc61flUMAtXIZY5TGA2DBMRHRtnpPC zgxQ== X-Gm-Message-State: AOAM530Sicye1vdXFawMp9sDnOZgBcY2kQwnRFw0CnkRwbC+NmpL0VvV 90BnMWSKQhP2Pf7L9jXSYX6QxFjtkHU= X-Received: by 2002:a7b:c44e:: with SMTP id l14mr257155wmi.185.1643227409993; Wed, 26 Jan 2022 12:03:29 -0800 (PST) Received: from [10.18.0.12] ([194.126.177.12]) by smtp.gmail.com with ESMTPSA id k25sm2266436wms.23.2022.01.26.12.03.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jan 2022 12:03:29 -0800 (PST) Message-ID: <0e1b25f6-d64f-a391-eca8-01b686377df0@gmail.com> Date: Wed, 26 Jan 2022 21:03:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH] platform: surface: Replace acpi_bus_get_device() Content-Language: en-US To: "Rafael J. Wysocki" , Hans de Goede Cc: LKML , Linux ACPI , Andy Shevchenko , platform-driver-x86@vger.kernel.org, Mark Gross References: <5805278.lOV4Wx5bFT@kreacher> From: Maximilian Luz In-Reply-To: <5805278.lOV4Wx5bFT@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/26/22 20:41, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Replace acpi_bus_get_device() that is going to be dropped with > acpi_fetch_acpi_dev(). > > No intentional functional impact. > > Signed-off-by: Rafael J. Wysocki Looks good to me. Reviewed-by: Maximilian Luz > --- > drivers/platform/surface/surface3-wmi.c | 12 ++++-------- > drivers/platform/surface/surface_acpi_notify.c | 3 ++- > 2 files changed, 6 insertions(+), 9 deletions(-) > > Index: linux-pm/drivers/platform/surface/surface3-wmi.c > =================================================================== > --- linux-pm.orig/drivers/platform/surface/surface3-wmi.c > +++ linux-pm/drivers/platform/surface/surface3-wmi.c > @@ -116,15 +116,11 @@ static acpi_status s3_wmi_attach_spi_dev > void *data, > void **return_value) > { > - struct acpi_device *adev, **ts_adev; > + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); > + struct acpi_device **ts_adev = data; > > - if (acpi_bus_get_device(handle, &adev)) > - return AE_OK; > - > - ts_adev = data; > - > - if (strncmp(acpi_device_bid(adev), SPI_TS_OBJ_NAME, > - strlen(SPI_TS_OBJ_NAME))) > + if (!adev || strncmp(acpi_device_bid(adev), SPI_TS_OBJ_NAME, > + strlen(SPI_TS_OBJ_NAME))) > return AE_OK; > > if (*ts_adev) { > Index: linux-pm/drivers/platform/surface/surface_acpi_notify.c > =================================================================== > --- linux-pm.orig/drivers/platform/surface/surface_acpi_notify.c > +++ linux-pm/drivers/platform/surface/surface_acpi_notify.c > @@ -770,7 +770,8 @@ static acpi_status san_consumer_setup(ac > return AE_OK; > > /* Ignore ACPI devices that are not present. */ > - if (acpi_bus_get_device(handle, &adev) != 0) > + adev = acpi_fetch_acpi_dev(handle); > + if (!adev) > return AE_OK; > > san_consumer_dbg(&pdev->dev, handle, "creating device link\n"); > > >