From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31CA4C433F5 for ; Tue, 12 Oct 2021 22:04:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 163FA61040 for ; Tue, 12 Oct 2021 22:04:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235638AbhJLWGU (ORCPT ); Tue, 12 Oct 2021 18:06:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232260AbhJLWGT (ORCPT ); Tue, 12 Oct 2021 18:06:19 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5788AC061570; Tue, 12 Oct 2021 15:04:17 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id g6so1747427ybb.3; Tue, 12 Oct 2021 15:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=auG+UMx9zytYp9lINzhPZO9u/TFK5cE+R08OejH5B0w=; b=ne7652o0LqsXxa1F1cgXnxgCK2bxwNWHDrsyhUBtlAmcbIV/AtPK8pJIgvmbUIbEaD h92TyPmec2iTl0SXhH/vi63WZzRK7W9caxUYKHcMVdC227jK67QU7owKiG83zjMU3MBb bb61mGP/yDMpyVAZSY0IJkRZEr5mk50g0hAEHr7RL+q8EBT1w+cNjzMVs2cIG0y5xbic 0W86qaLtxTeBPyMXA9tztIq7/maRwyqxexf/TqB2kPSdB0xbM9RVHUrOajFjEvlJyYQ0 dktD5Gp41bhoYKK2kIZbhi3WP5OQSlqIMuFHUEaAawTV36hlLtIqFepSObHS1+HC79YP Ogiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=auG+UMx9zytYp9lINzhPZO9u/TFK5cE+R08OejH5B0w=; b=TgVVpCFeeQ/vQKCJOJ4iQ8J/rUKOflS5NOQ4+8PWCVLXWt5a8KXQjIE/5V5V89Wsnn J7GckFl/P5kaxqpxoNsoGT645gB5zGXaX8gFpQqWQGhF7UiVQB6qw6G/Ln3vHyYSFC4I cI1HKbLrGc3SVSlctH50+Y8QO/S6xE5GkMmF2T/QPZ/6DMsclhLXWaAyzMq3XAC/jcpd BSnvKuZGF4QDLU88pfrDLNCjRh2+ecuDgexjMBavV6kN0mnE8Cj8nnqEwgihFI0YQ7SF OmDAEUMM/35yLYPgaJmU7EIlzFpu3I1BEFnlVgNAuDpSoF1XsHjvtAz0y3an2NnWenwW 7SOg== X-Gm-Message-State: AOAM531zKIk+pDt4q7UKMdtOOIzAnkeKv9nRlj8MyJ1LC/TIc2YbDjTG 4f7kJMH0fUpMHRX9x3/QZd1fIooEkC+yIRiKW8k= X-Google-Smtp-Source: ABdhPJy122ifGFhlEjzoGnOh1Y838UQ+5VnA3gX7zYtFxeJ4IZzHKXhB7X/f+krIMq3PbEeKYpoBnJ7DKFa3wwIoKco= X-Received: by 2002:a25:9a81:: with SMTP id s1mr32001654ybo.230.1634076256610; Tue, 12 Oct 2021 15:04:16 -0700 (PDT) MIME-Version: 1.0 References: <4369779.LvFx2qVVIh@kreacher> <21245442.EfDdHjke4D@kreacher> In-Reply-To: <21245442.EfDdHjke4D@kreacher> From: Ben Skeggs Date: Wed, 13 Oct 2021 08:04:05 +1000 Message-ID: Subject: Re: [PATCH v1 2/7] nouveau: ACPI: Use the ACPI_COMPANION() macro directly To: "Rafael J. Wysocki" Cc: Linux ACPI , LKML , Ben Skeggs , ML dri-devel , ML nouveau Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Wed, 13 Oct 2021 at 03:58, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > The ACPI_HANDLE() macro is a wrapper arond the ACPI_COMPANION() > macro and the ACPI handle produced by the former comes from the > ACPI device object produced by the latter, so it is way more > straightforward to evaluate the latter directly instead of passing > the handle produced by the former to acpi_bus_get_device(). > > Modify nouveau_acpi_edid() accordingly (no intentional functional > impact). > > Signed-off-by: Rafael J. Wysocki Reviewed-by: Ben Skeggs > --- > drivers/gpu/drm/nouveau/nouveau_acpi.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > Index: linux-pm/drivers/gpu/drm/nouveau/nouveau_acpi.c > =================================================================== > --- linux-pm.orig/drivers/gpu/drm/nouveau/nouveau_acpi.c > +++ linux-pm/drivers/gpu/drm/nouveau/nouveau_acpi.c > @@ -364,7 +364,6 @@ void * > nouveau_acpi_edid(struct drm_device *dev, struct drm_connector *connector) > { > struct acpi_device *acpidev; > - acpi_handle handle; > int type, ret; > void *edid; > > @@ -377,12 +376,8 @@ nouveau_acpi_edid(struct drm_device *dev > return NULL; > } > > - handle = ACPI_HANDLE(dev->dev); > - if (!handle) > - return NULL; > - > - ret = acpi_bus_get_device(handle, &acpidev); > - if (ret) > + acpidev = ACPI_COMPANION(dev->dev); > + if (!acpidev) > return NULL; > > ret = acpi_video_get_edid(acpidev, type, -1, &edid); > > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C5ABC433FE for ; Tue, 12 Oct 2021 22:04:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E9F1E60E78 for ; Tue, 12 Oct 2021 22:04:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E9F1E60E78 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 31CFD6E9E9; Tue, 12 Oct 2021 22:04:19 +0000 (UTC) Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6B6DD6E9E5; Tue, 12 Oct 2021 22:04:17 +0000 (UTC) Received: by mail-yb1-xb34.google.com with SMTP id a7so1706234yba.6; Tue, 12 Oct 2021 15:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=auG+UMx9zytYp9lINzhPZO9u/TFK5cE+R08OejH5B0w=; b=ne7652o0LqsXxa1F1cgXnxgCK2bxwNWHDrsyhUBtlAmcbIV/AtPK8pJIgvmbUIbEaD h92TyPmec2iTl0SXhH/vi63WZzRK7W9caxUYKHcMVdC227jK67QU7owKiG83zjMU3MBb bb61mGP/yDMpyVAZSY0IJkRZEr5mk50g0hAEHr7RL+q8EBT1w+cNjzMVs2cIG0y5xbic 0W86qaLtxTeBPyMXA9tztIq7/maRwyqxexf/TqB2kPSdB0xbM9RVHUrOajFjEvlJyYQ0 dktD5Gp41bhoYKK2kIZbhi3WP5OQSlqIMuFHUEaAawTV36hlLtIqFepSObHS1+HC79YP Ogiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=auG+UMx9zytYp9lINzhPZO9u/TFK5cE+R08OejH5B0w=; b=ABmq6ASLKfjpmgAmpmUyTw3eE3bB6BhUaYS5lT+IpAWcdJbaaQ9H49ESF7bgtdh4er FEcly0xqyKGqszz48BZ1IYEqKS/zjuIn0Y6A2N2TxonAFWJMEzmYOckrrlQumAECzUkX o477a+tl0E3gB2jeipl3PPiNkGCUfw59giWxBSa8SZ709j9Ghtql5OWywEA3msDhWnTY SyUr5CYkYNZlUBq6YOxCu2P/S+eoALSywutA97VL68FPtSSIVpVFRK1OcmVwy4FJd6CK +fSSHN8i+Qa5lDSJig2m7BRxzHgrTOoIZN4IiQdigpMKG4XZKeKZAF9vA1XYX4NVEVlJ fjJw== X-Gm-Message-State: AOAM5304PYO131QfHf43R4v+8y347NX6TS6IwFszRi/05d+EI5h5q9OX nAnPQgLCRB6egmOtCo8xynXFkadFbM9IbBP5Gw8= X-Google-Smtp-Source: ABdhPJy122ifGFhlEjzoGnOh1Y838UQ+5VnA3gX7zYtFxeJ4IZzHKXhB7X/f+krIMq3PbEeKYpoBnJ7DKFa3wwIoKco= X-Received: by 2002:a25:9a81:: with SMTP id s1mr32001654ybo.230.1634076256610; Tue, 12 Oct 2021 15:04:16 -0700 (PDT) MIME-Version: 1.0 References: <4369779.LvFx2qVVIh@kreacher> <21245442.EfDdHjke4D@kreacher> In-Reply-To: <21245442.EfDdHjke4D@kreacher> From: Ben Skeggs Date: Wed, 13 Oct 2021 08:04:05 +1000 Message-ID: To: "Rafael J. Wysocki" Cc: Linux ACPI , LKML , Ben Skeggs , ML dri-devel , ML nouveau Content-Type: text/plain; charset="UTF-8" Subject: Re: [Nouveau] [PATCH v1 2/7] nouveau: ACPI: Use the ACPI_COMPANION() macro directly X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Wed, 13 Oct 2021 at 03:58, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > The ACPI_HANDLE() macro is a wrapper arond the ACPI_COMPANION() > macro and the ACPI handle produced by the former comes from the > ACPI device object produced by the latter, so it is way more > straightforward to evaluate the latter directly instead of passing > the handle produced by the former to acpi_bus_get_device(). > > Modify nouveau_acpi_edid() accordingly (no intentional functional > impact). > > Signed-off-by: Rafael J. Wysocki Reviewed-by: Ben Skeggs > --- > drivers/gpu/drm/nouveau/nouveau_acpi.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > Index: linux-pm/drivers/gpu/drm/nouveau/nouveau_acpi.c > =================================================================== > --- linux-pm.orig/drivers/gpu/drm/nouveau/nouveau_acpi.c > +++ linux-pm/drivers/gpu/drm/nouveau/nouveau_acpi.c > @@ -364,7 +364,6 @@ void * > nouveau_acpi_edid(struct drm_device *dev, struct drm_connector *connector) > { > struct acpi_device *acpidev; > - acpi_handle handle; > int type, ret; > void *edid; > > @@ -377,12 +376,8 @@ nouveau_acpi_edid(struct drm_device *dev > return NULL; > } > > - handle = ACPI_HANDLE(dev->dev); > - if (!handle) > - return NULL; > - > - ret = acpi_bus_get_device(handle, &acpidev); > - if (ret) > + acpidev = ACPI_COMPANION(dev->dev); > + if (!acpidev) > return NULL; > > ret = acpi_video_get_edid(acpidev, type, -1, &edid); > > >