Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3649599pxf; Mon, 29 Mar 2021 07:53:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZU+5tqZgLMQux8hfzts8Eb8vFv1mzmDDMAVjS+udL1wjQuwmhKlYmHmMuZ5FWSBQcjHTb X-Received: by 2002:a17:906:1dd3:: with SMTP id v19mr28628759ejh.4.1617029622572; Mon, 29 Mar 2021 07:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617029622; cv=none; d=google.com; s=arc-20160816; b=YfnrZummmBdOpl4SFoNbVWRQEnE172h3N3p87QDja+F5/1rm+KycnAy9sZm6CPrB+c /1S/P4HZmbW8/eXUAekAw/XdbDpvX7r0pTuZdBsaOUK5H15E2flGiGjun5RFaPHAruZ8 arZUFBx+serG/TGqZrGtu5PY1mMq+pLONVIDzGOGLKD+HymAM3uqOaHr/pehTH+0P9M4 7ZdtySAXm1g09cODQvMwNw7uBF49H7PSzzsjeMbiYSQC4Km6BBMOCmz00aWRRPH6hrV9 ibuEGi00x8QBJ5MVlXXPXBbc+QKcDZogcAyV7tpecZczAVg7XGrRQeETMOyzta0wnpJi Wspg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=OjTQXmSwyXlGBhYyZS9QxKcbI4BsZf/3tkijahne9K0=; b=zfsmaheJVGeLo2ypVTgBGXd1xoB2AkRSE5JlnokKfvvDAzQcRNh7Q2MGFQT1LP8XpC oVHzkJUHm6k9C4GaaLrWSQijidO1Nve1NbwmnjsUET0YvLqi+9JgkeoW3PkD+9vICLha JJaErlub9Q9xVSWgh3SaWJGTjD+udrGhUxIqd3QzjRJZA5ThvDo651zhbxbfMv/gztx4 ShKQEFux+TwsHP/S9KjFkj4IFuYF9f2tsAChshFV8JTpk600EhMl2EpioeXzYE7LxcA/ B0x2bL2Ln4MlLWMPTf6ql+Aoo0/TEu3IVBTsiwowb7w4yqUgO74kWQl5RPO/bJtOLF6f AT6Q== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a4si13590381edq.271.2021.03.29.07.53.19; Mon, 29 Mar 2021 07:53:42 -0700 (PDT) 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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231233AbhC2Ou4 (ORCPT + 99 others); Mon, 29 Mar 2021 10:50:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:42222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231479AbhC2Oun (ORCPT ); Mon, 29 Mar 2021 10:50:43 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A138F61932; Mon, 29 Mar 2021 14:50:40 +0000 (UTC) Date: Mon, 29 Mar 2021 15:50:46 +0100 From: Jonathan Cameron To: Alexandru Ardelean Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, coproscefalo@gmail.com, hdegoede@redhat.com, mgross@linux.intel.com, linux@deviqon.com Subject: Re: [PATCH 05/10] platform/x86: toshiba_acpi: register backlight with device-managed variant Message-ID: <20210329155046.125641ac@jic23-huawei> In-Reply-To: <20210324125548.45983-6-aardelean@deviqon.com> References: <20210324125548.45983-1-aardelean@deviqon.com> <20210324125548.45983-6-aardelean@deviqon.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 24 Mar 2021 14:55:43 +0200 Alexandru Ardelean wrote: > This change converts the registration of the backlight data with the > devm_backlight_device_register() function. > This way, the backlight_device_unregister() call is no longer required, and > the order of deregistration is made to be more symmetrical with the > registration order. > This one looks fine to me. > Signed-off-by: Alexandru Ardelean Reviewed-by: Jonathan Cameron > --- > drivers/platform/x86/toshiba_acpi.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c > index 556f2cc99bad..ada2a2d8c913 100644 > --- a/drivers/platform/x86/toshiba_acpi.c > +++ b/drivers/platform/x86/toshiba_acpi.c > @@ -2876,7 +2876,8 @@ static int toshiba_acpi_setup_keyboard(struct device *parent, > return error; > } > > -static int toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev) > +static int toshiba_acpi_setup_backlight(struct device *parent, > + struct toshiba_acpi_dev *dev) > { > struct backlight_properties props; > int brightness; > @@ -2924,11 +2925,12 @@ static int toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev) > if (dev->tr_backlight_supported) > props.max_brightness++; > > - dev->backlight_dev = backlight_device_register("toshiba", > - &dev->acpi_dev->dev, > - dev, > - &toshiba_backlight_data, > - &props); > + dev->backlight_dev = devm_backlight_device_register(parent, > + "toshiba", > + &dev->acpi_dev->dev, > + dev, > + &toshiba_backlight_data, > + &props); > if (IS_ERR(dev->backlight_dev)) { > ret = PTR_ERR(dev->backlight_dev); > pr_err("Could not register toshiba backlight device\n"); > @@ -2999,8 +3001,6 @@ static int toshiba_acpi_remove(struct acpi_device *acpi_dev) > sysfs_remove_group(&dev->acpi_dev->dev.kobj, > &toshiba_attr_group); > > - backlight_device_unregister(dev->backlight_dev); > - > led_classdev_unregister(&dev->led_dev); > led_classdev_unregister(&dev->kbd_led); > led_classdev_unregister(&dev->eco_led); > @@ -3104,9 +3104,9 @@ static int toshiba_acpi_add(struct acpi_device *acpi_dev) > ret = get_tr_backlight_status(dev, &dummy); > dev->tr_backlight_supported = !ret; > > - ret = toshiba_acpi_setup_backlight(dev); > + ret = toshiba_acpi_setup_backlight(parent, dev); > if (ret) > - goto error; > + return ret; > > toshiba_illumination_available(dev); > if (dev->illumination_supported) {