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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55639ECAAD3 for ; Mon, 19 Sep 2022 17:42:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230246AbiISRmd (ORCPT ); Mon, 19 Sep 2022 13:42:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbiISRm3 (ORCPT ); Mon, 19 Sep 2022 13:42:29 -0400 Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18E04422CB; Mon, 19 Sep 2022 10:42:27 -0700 (PDT) Date: Mon, 19 Sep 2022 17:42:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1663609345; x=1663868545; bh=H1kQb3nW7uX+EQ7dI51yCfmSThnS5rQTaBAtat/cQa0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=EvtG51QQFuE6OuwoSuVwn8/0/t1ldc8h2OExykjwbo7OVd9HzecrXmBPrg5JFbkvY 3G4N9woPZFDewBJML/LjtDNVO7dgRlwU5T6onepzkf1BsYt0yUDAhY/mLe5dRNMGTA gQkr0XjzXwyOk/3iyJ+MuKdJWBZEMWiy1pJpvUQrrbhngoFRws9AAj1FB5W0AYObcM GEzA71ZIYLFj1+/pgDXQlqfPvvKk+NaxNpcPcUZQ9Z7huyhYyBPBUfs0O51LWvt9PW D93ByrKn2YAwaAzicNkB56AA4bJHSUaZlhaCa1OXJezs1lmjsFCZmmxSEFLcWG67Ef Q59bf+PfHTkJw== To: Armin Wolf From: =?utf-8?Q?Barnab=C3=A1s_P=C5=91cze?= Cc: hdegoede@redhat.com, markgross@kernel.org, rafael@kernel.org, lenb@kernel.org, hmh@hmh.eng.br, matan@svgalib.org, corentin.chary@gmail.com, jeremy@system76.com, productdev@system76.com, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/5] ACPI: battery: Allow battery hooks to be registered multiple times. Message-ID: In-Reply-To: <155062a9-8d1a-e771-1bee-35580b1b2b73@gmx.de> References: <20220912125342.7395-1-W_Armin@gmx.de> <20220912125342.7395-4-W_Armin@gmx.de> <155062a9-8d1a-e771-1bee-35580b1b2b73@gmx.de> Feedback-ID: 20568564:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi 2022. szeptember 12., h=C3=A9tf=C5=91 19:29 keltez=C3=A9ssel, Armin Wolf =C3=ADrta: > Am 12.09.22 um 18:42 schrieb Barnab=C3=A1s P=C5=91cze: >=20 > > Hi > >=20 > > 2022. szeptember 12., h=C3=A9tf=C5=91 14:53 keltez=C3=A9ssel, Armin Wol= f =C3=ADrta: > >=20 > > > Registering multiple instances of a battery hook is beneficial > > > for drivers which can be instantiated multiple times. Until now, > > > this would mean that such a driver would have to implement some > > > logic to manage battery hooks. > > >=20 > > > Extend the battery hook handling instead. > > > I think this is already possible by embedding the acpi_battery_hook > > > object inside the driver's device specific data object, no? > >=20 > > Regards, > > Barnab=C3=A1s P=C5=91cze >=20 > Yes, it indeed is. However afaik it is not possible to pass instance-spec= ific > data to such an embedded battery hook. It could be possible by passing th= e > battery hook as an argument to add_battery()/remove_battery() and using c= ontainer_of(), > but in my opinion this would be too much of a quick hack. Good point about the instance-specific data. However, regarding the second = point, I am with Hans. I do not really think it is that big of a hack. It is inher= itance. Regards, Barnab=C3=A1s P=C5=91cze