Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2097596rda; Tue, 24 Oct 2023 12:11:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHe9lA9nv/gPIGPZsELtRprbQjBW+y5AEe/Fn3Cw/XgQL/dgAeVDYSFwCxmFM6frTKq9Lg X-Received: by 2002:a05:6a21:4842:b0:16a:4480:647f with SMTP id au2-20020a056a21484200b0016a4480647fmr3540014pzc.19.1698174714732; Tue, 24 Oct 2023 12:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698174714; cv=none; d=google.com; s=arc-20160816; b=v/xhnDVp5fSeLRzDpt3Ozcc+B3kFst25NLSpljoSqZO4oO2TKE29unmrJZ211EUDRP QnaKShT8NkqnkEuO+OhIkkXnBgscRX0A3siQW8xBDrBdW5POWMBTQdv3b4fghukbQ8PL igYMSp3qy6z+wGZxjzVrt9DFEHIpZx9rVxOeQIK0HCbtmYgVweJRGrjueKzGhzB6lYUN /Q0H2EIlMFG/qZcwSrncrscRkqnFjx/0IJD0fCp45abllYgsOPfgdGGpiHd+vOanxUiz ayPXbAE0IIX/UyxRw/vZ/Gio/WPgRAOimXPNEzdTVrGN3KCe42wtx5w6ntifh/wU76mf 6Dfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=QshHicIHQAmwkKJoXKajHrwc+HmPk91Vawu6Og0mshk=; fh=UzbTbqfR96n49G2J7vG/9RdhA7gwOX4/9MYBfN5rJ30=; b=VimkSprq3VrAbGS6LIarlQuZTYv1bUFoKqd4+HKV/g96wczrnxPFHdzOBkmcXjIQcj igoax3pPwy2i/W0XAumTK1IiELykt/xXsYXCAY1FsZMHJAb956s9jW2bEZ5xYcn7M230 hCjMynSPIqp93sUJof79Ba5keCaqRivewc3sej/82JYS+KyF65MxzRhWBi+KK5gK39O8 uCc3lPpD21dMecV5wcwiE24vcvV/nqxbFZfDClgtcd7v2PAQeHAPQDNuGi8p2f8s5NOl gbxdCA3A+STYe0wJF7F9TSkaptyqNTN2qGbaSaLiL4TA1EhqBQWA2u/8kOo4dPebKXfD n+qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id b26-20020a63931a000000b0056fa1ac3722si8770713pge.698.2023.10.24.12.11.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 12:11:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id B9ECC80216B5; Tue, 24 Oct 2023 12:11:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344296AbjJXTLa convert rfc822-to-8bit (ORCPT + 99 others); Tue, 24 Oct 2023 15:11:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344307AbjJXTLW (ORCPT ); Tue, 24 Oct 2023 15:11:22 -0400 Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15985172D; Tue, 24 Oct 2023 12:11:10 -0700 (PDT) Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-1d542f05b9aso856739fac.1; Tue, 24 Oct 2023 12:11:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698174670; x=1698779470; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gcA54zDLoesBIrcjaHX+r3abJJ7T9P6KPfRRYuwNMO0=; b=RbwbknzfrdS5GHHa7E4wlY3IjcCDCji4Xv83xaKjfTCxFxywDmUBKI4uSFI4vNYYh9 yxIU36tuS9/cxjcdD+i86DPqdFrcHjA/KHPo07YHTB/3xjyvvSx72qrK1uTheYlu/dWT 2vTtrJDV4tj/ndL+zuF17uReBF44Qz64q79U6rXZA+wYa8DnlW9b3x1hlBgcZ3OKyINe CpF4bH85/04AMz6ismEQw77euweRVAc6rS7qRpFTJvzhjNjXBAc2q2LRsvKJI3UtOjtg 9Hycj0q4DGwVebIecodYZ2tZAloPx9wra9wbTrm/u3UgC4b4GjGWqCiLrV1eH2qQBmyV 4zfg== X-Gm-Message-State: AOJu0Yx/rIDUzB7KIOxmiEZ+kR8gasnBbGAs3ezBzzmmUetl5sqfJYLj TO8/8HdUaPTMf7qdt+wlmQJYuFD6gkCbSB3wCdH+dWBi X-Received: by 2002:a05:6871:220e:b0:1e9:adec:bf5e with SMTP id sc14-20020a056871220e00b001e9adecbf5emr13384947oab.2.1698174670028; Tue, 24 Oct 2023 12:11:10 -0700 (PDT) MIME-Version: 1.0 References: <20231018190945.252428-1-michal.wilczynski@intel.com> <20231018190945.252428-2-michal.wilczynski@intel.com> In-Reply-To: <20231018190945.252428-2-michal.wilczynski@intel.com> From: "Rafael J. Wysocki" Date: Tue, 24 Oct 2023 21:10:58 +0200 Message-ID: Subject: Re: [PATCH v2 1/3] ACPI: acpi_pad: Replace acpi_driver with platform_driver To: Michal Wilczynski Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, rafael.j.wysocki@intel.com, andriy.shevchenko@linux.intel.com, lenb@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 24 Oct 2023 12:11:52 -0700 (PDT) On Wed, Oct 18, 2023 at 10:37 PM Michal Wilczynski wrote: > > The acpi_pad driver uses struct acpi_driver to register itself while it > would be more logically consistent to use struct platform_driver for this > purpose, because the corresponding platform device is present and the > role of struct acpi_device is to amend the other bus types. ACPI devices > are not meant to be used as proper representation of hardware entities, > but to collect information on those hardware entities provided by the > platform firmware. > > Use struct platform_driver for registering the acpi_pad driver. > > Suggested-by: Rafael J. Wysocki > Signed-off-by: Michal Wilczynski > --- > drivers/acpi/acpi_pad.c | 25 ++++++++++++++----------- > 1 file changed, 14 insertions(+), 11 deletions(-) > > diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c > index 7a453c5ff303..25068f2c5b4d 100644 > --- a/drivers/acpi/acpi_pad.c > +++ b/drivers/acpi/acpi_pad.c > @@ -18,6 +18,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -430,8 +431,9 @@ static void acpi_pad_notify(acpi_handle handle, u32 event, > } > } > > -static int acpi_pad_add(struct acpi_device *device) > +static int acpi_pad_probe(struct platform_device *pdev) > { > + struct acpi_device *device = ACPI_COMPANION(&pdev->dev); > acpi_status status; > > strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME); > @@ -450,8 +452,10 @@ static int acpi_pad_add(struct acpi_device *device) > return 0; > } > > -static void acpi_pad_remove(struct acpi_device *device) > +static void acpi_pad_remove(struct platform_device *pdev) > { > + struct acpi_device *device = ACPI_COMPANION(&pdev->dev); > + > mutex_lock(&isolated_cpus_lock); > acpi_pad_idle_cpus(0); > mutex_unlock(&isolated_cpus_lock); > @@ -467,13 +471,12 @@ static const struct acpi_device_id pad_device_ids[] = { > }; > MODULE_DEVICE_TABLE(acpi, pad_device_ids); > > -static struct acpi_driver acpi_pad_driver = { > - .name = "processor_aggregator", > - .class = ACPI_PROCESSOR_AGGREGATOR_CLASS, > - .ids = pad_device_ids, > - .ops = { > - .add = acpi_pad_add, > - .remove = acpi_pad_remove, > +static struct platform_driver acpi_pad_driver = { > + .probe = acpi_pad_probe, > + .remove_new = acpi_pad_remove, > + .driver = { > + .name = "processor_aggregator", > + .acpi_match_table = pad_device_ids, > }, > }; > > @@ -487,12 +490,12 @@ static int __init acpi_pad_init(void) > if (power_saving_mwait_eax == 0) > return -EINVAL; > > - return acpi_bus_register_driver(&acpi_pad_driver); > + return platform_driver_register(&acpi_pad_driver); > } > > static void __exit acpi_pad_exit(void) > { > - acpi_bus_unregister_driver(&acpi_pad_driver); > + platform_driver_unregister(&acpi_pad_driver); > } > > module_init(acpi_pad_init); > -- Applied as 6.7 material along with the rest of the series, thanks!