Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp836185rdb; Sat, 7 Oct 2023 00:56:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFprR8gbyZZL6P8slbqhHsOMzZSioqOU4qDhCuRi4prFQN5PfFY1/XbGEUkHVvhLLn2QLW5 X-Received: by 2002:a05:6871:829:b0:1d0:fa7b:c3f9 with SMTP id q41-20020a056871082900b001d0fa7bc3f9mr11901988oap.30.1696665400047; Sat, 07 Oct 2023 00:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696665400; cv=none; d=google.com; s=arc-20160816; b=nWcfp8zXfnSOkIwYgds6dz31dc7AGngYbMRACfSAvTp/AL/6MX17Xfw4+MwcYiNM+1 TRKKvGCd8PKxExlp2HlfhCrAKi+QRHouQaNbVeeVcfeXfxmpwzjE0uRGC1PqmRIzlN7l HdzxoEECAs5Cx9t3Vn6bgXjdVY8FMzYvwxtptbY+foBGBtW4mk3L4VfREupWpgTMSPtk BcB1pMdsOg/wiwqC6Uw9QTLixyyDK6XKwaLxRYsVe5HM3UNYxunXnXM9/JWY5znFpGIr LVtlfA75H2K5nfk4opE+fTRbNbzcQGzFErnSZqUI940A7P81qit4AVbzEqWvbBFED+6l Tu6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yOELLg8w9Sghbp3xU3Ci4cuKHJ0zGNWM4CMrUdh2FjM=; fh=LCXpMblzm0L+ZY5zkTKp8tedw4Eyaz2qkLt3Z+W/EKQ=; b=wUGgFFS0oYoGcNQD7MRMLE8vWsTvd3voaWCi9MJl+rC6G8hzOik5qeqK+29/Jj7iJ4 GmD4ngaLlYM1+lVVwk+yEHOQ3HYNhNFwYnFREr9a4f+FVawaqQ6g/RbeDCqCTrb535Pn KU8QgOrlIJ4cb27NgGllZpDhcOIIz/2xVslLtUvFTZw5SfbLmID8w45qCSksG+pwYRYH qSPwmc2ymDkLJATsyanYpS2/fJAf2KNpyV01G1smy4OFQjs+wm2y/41V3Xd7oggs0s1I 36Xj/urJiWJyHzqvwcIcgQl9wvTDoFE9nBJgqq8EaAGlD7q7bkaGNI/qe3JzLddvrojI 0o9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KxQPJxvS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id j63-20020a638b42000000b005653e3f6d58si200511pge.748.2023.10.07.00.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 00:56:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KxQPJxvS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 853D080BB5EF; Sat, 7 Oct 2023 00:56:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343780AbjJGH4Z (ORCPT + 99 others); Sat, 7 Oct 2023 03:56:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343792AbjJGH4T (ORCPT ); Sat, 7 Oct 2023 03:56:19 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2889F0; Sat, 7 Oct 2023 00:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696665376; x=1728201376; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=w37Uw2egK4TMI1TPq7330xWPQb1w+wAKmOmwEmrT3m8=; b=KxQPJxvSJ7vrl00Wpujm7aNarHRDKPbrhBXv4qCBbVyyG4u7Z99DkiQe xm/WUTnH7dnvva+TNQ8xN7U8zOffqkVdWJ5+gWu1kmJ3pBdpMxJQIJlP5 Ju9hshBQWoOLiLvLaIk6hozVT/pSUK45nb29rcTyjnP1byNPKvDOvQHuC 7DRfsewY9NfKaM67oRKj5X0kXbRx0NS3kXoe1tPVMAOA9PDREUMh95jJy EvRfJjSV5MCErAX6ybmIcKmLdSkCRBrHqZ8bxHRaoa4WNqs1FAo6xPlbO sGcr7x76aZ95ShVvyJ8xLDvH2kh/D8Y1/a5PBd/dOEYOY8fuQ2NdfsR32 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="364189414" X-IronPort-AV: E=Sophos;i="6.03,205,1694761200"; d="scan'208";a="364189414" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2023 00:56:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="702318560" X-IronPort-AV: E=Sophos;i="6.03,205,1694761200"; d="scan'208";a="702318560" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2023 00:56:13 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC1) (envelope-from ) id 1qp2AV-00000003Y0V-01aV; Sat, 07 Oct 2023 10:56:11 +0300 Date: Sat, 7 Oct 2023 10:56:10 +0300 From: Andy Shevchenko To: "Rafael J. Wysocki" Cc: Michal Wilczynski , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, rafael.j.wysocki@intel.com, lenb@kernel.org, dan.j.williams@intel.com, vishal.l.verma@intel.com, ira.weiny@intel.com Subject: Re: [PATCH v2 3/6] ACPI: AC: Replace acpi_driver with platform_driver Message-ID: References: <20231006173055.2938160-1-michal.wilczynski@intel.com> <20231006173055.2938160-4-michal.wilczynski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Sat, 07 Oct 2023 00:56:37 -0700 (PDT) X-Spam-Level: ** On Fri, Oct 06, 2023 at 09:47:57PM +0200, Rafael J. Wysocki wrote: > On Fri, Oct 6, 2023 at 8:33 PM Michal Wilczynski > wrote: ... > > struct acpi_ac { > > struct power_supply *charger; > > struct power_supply_desc charger_desc; > > - struct acpi_device *device; > > + struct device *dev; > > I'm not convinced about this change. > > If I'm not mistaken, you only use the dev pointer above to get the > ACPI_COMPANION() of it, but the latter is already found in _probe(), > so it can be stored in struct acpi_ac for later use and then the dev > pointer in there will not be necessary any more. > > That will save you a bunch of ACPI_HANDLE() evaluations and there's > nothing wrong with using ac->device->handle. The patch will then > become almost trivial AFAICS and if you really need to get from ac to > the underlying platform device, a pointer to it can be added to struct > acpi_ac without removing the ACPI device pointer from it. The idea behind is to eliminate data duplication. > > unsigned long long state; > > struct notifier_block battery_nb; > > }; -- With Best Regards, Andy Shevchenko