From patchwork Mon Apr 24 13:33:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= X-Patchwork-Id: 9696385 X-Patchwork-Delegate: dvhart@infradead.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 15C61601AE for ; Mon, 24 Apr 2017 13:34:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0786226247 for ; Mon, 24 Apr 2017 13:34:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F08CA2818B; Mon, 24 Apr 2017 13:34:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B94D26247 for ; Mon, 24 Apr 2017 13:34:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1171256AbdDXNd7 (ORCPT ); Mon, 24 Apr 2017 09:33:59 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34622 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1171307AbdDXNdo (ORCPT ); Mon, 24 Apr 2017 09:33:44 -0400 Received: by mail-lf0-f67.google.com with SMTP id x72so16554013lfb.1 for ; Mon, 24 Apr 2017 06:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kempniu.pl; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1UzgpoXFsYvG5nORhP78CTBS8BTaMHD7G8aPwKSWQCs=; b=hARx+UJ1ml3yjNJt7s16cBcg6S2nHIO7rjJXH/A27rJ9Y5cRwBbFZkBMrkrN2pZtv6 Val8kpVuuOGZOkCVDY99XVe/gYcXzSDbcGSM64+nEhgfhjEdGe4Z8VPpnx9FC4CABjMU w9NVJTUfQvCfLMsD4FAI5LQ/oStLTJ7SIyURU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1UzgpoXFsYvG5nORhP78CTBS8BTaMHD7G8aPwKSWQCs=; b=rykPunfxOih6zNSCYza3HQ732hx6bCCaVSEhQuhcsId3k+1gG+C24JwD8Q6iA3WfU4 upLJBe/QKvqoLWWO7qYAeHRxPxowEKd42WhdgVZqtyK1jfre5G10S3MAVSc1synVE4bv 8p/aAslnOSUHxPyYHly30gSqu4dx2UPo5xiYLLhcu47sXU2StrNLcahobWTvSg3Me8/J ncJf7Vlkk+WBe+41UZVN9llRiiHa4Y545DvVXkp1prkCQuZ3asNmGXG6jT6eMeP+CQ9/ wHYlVaKK8KFTJM7u+FDsM6/nM28Wdj38K3t5wedQQsssK6XBQANikdtNWRDr7jGfVm9d /SDg== X-Gm-Message-State: AN3rC/4Bh0V35otYddpN1D71Gy328VwblTbO0EmTV/xaN6xQud5tYoic HOnoJDTh1I2Xgw== X-Received: by 10.46.9.197 with SMTP id 188mr9641523ljj.23.1493040822316; Mon, 24 Apr 2017 06:33:42 -0700 (PDT) Received: from ozzy.hq.kempniu.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id 69sm3346138lfq.36.2017.04.24.06.33.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Apr 2017 06:33:41 -0700 (PDT) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Jonathan Woithe , Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/10] platform/x86: fujitsu-laptop: distinguish current uses of device-specific data Date: Mon, 24 Apr 2017 15:33:29 +0200 Message-Id: <20170424133334.7064-6-kernel@kempniu.pl> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170424133334.7064-1-kernel@kempniu.pl> References: <20170424133334.7064-1-kernel@kempniu.pl> MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In portions of the driver which use device-specific data, rename local variables from fujitsu_bl and fujitsu_laptop to priv in order to clearly distinguish these parts from code that uses module-wide data. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 48 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 5f6b34a97348..536b601c7067 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -369,26 +369,26 @@ static const struct key_entry keymap_backlight[] = { static int acpi_fujitsu_bl_input_setup(struct acpi_device *device) { - struct fujitsu_bl *fujitsu_bl = acpi_driver_data(device); + struct fujitsu_bl *priv = acpi_driver_data(device); int ret; - fujitsu_bl->input = devm_input_allocate_device(&device->dev); - if (!fujitsu_bl->input) + priv->input = devm_input_allocate_device(&device->dev); + if (!priv->input) return -ENOMEM; - snprintf(fujitsu_bl->phys, sizeof(fujitsu_bl->phys), - "%s/video/input0", acpi_device_hid(device)); + snprintf(priv->phys, sizeof(priv->phys), "%s/video/input0", + acpi_device_hid(device)); - fujitsu_bl->input->name = acpi_device_name(device); - fujitsu_bl->input->phys = fujitsu_bl->phys; - fujitsu_bl->input->id.bustype = BUS_HOST; - fujitsu_bl->input->id.product = 0x06; + priv->input->name = acpi_device_name(device); + priv->input->phys = priv->phys; + priv->input->id.bustype = BUS_HOST; + priv->input->id.product = 0x06; - ret = sparse_keymap_setup(fujitsu_bl->input, keymap_backlight, NULL); + ret = sparse_keymap_setup(priv->input, keymap_backlight, NULL); if (ret) return ret; - return input_register_device(fujitsu_bl->input); + return input_register_device(priv->input); } static int fujitsu_backlight_register(struct acpi_device *device) @@ -566,27 +566,27 @@ static const struct dmi_system_id fujitsu_laptop_dmi_table[] = { static int acpi_fujitsu_laptop_input_setup(struct acpi_device *device) { - struct fujitsu_laptop *fujitsu_laptop = acpi_driver_data(device); + struct fujitsu_laptop *priv = acpi_driver_data(device); int ret; - fujitsu_laptop->input = devm_input_allocate_device(&device->dev); - if (!fujitsu_laptop->input) + priv->input = devm_input_allocate_device(&device->dev); + if (!priv->input) return -ENOMEM; - snprintf(fujitsu_laptop->phys, sizeof(fujitsu_laptop->phys), - "%s/video/input0", acpi_device_hid(device)); + snprintf(priv->phys, sizeof(priv->phys), "%s/video/input0", + acpi_device_hid(device)); - fujitsu_laptop->input->name = acpi_device_name(device); - fujitsu_laptop->input->phys = fujitsu_laptop->phys; - fujitsu_laptop->input->id.bustype = BUS_HOST; - fujitsu_laptop->input->id.product = 0x06; + priv->input->name = acpi_device_name(device); + priv->input->phys = priv->phys; + priv->input->id.bustype = BUS_HOST; + priv->input->id.product = 0x06; dmi_check_system(fujitsu_laptop_dmi_table); - ret = sparse_keymap_setup(fujitsu_laptop->input, keymap, NULL); + ret = sparse_keymap_setup(priv->input, keymap, NULL); if (ret) return ret; - return input_register_device(fujitsu_laptop->input); + return input_register_device(priv->input); } static int fujitsu_laptop_platform_add(void) @@ -885,11 +885,11 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) static int acpi_fujitsu_laptop_remove(struct acpi_device *device) { - struct fujitsu_laptop *fujitsu_laptop = acpi_driver_data(device); + struct fujitsu_laptop *priv = acpi_driver_data(device); fujitsu_laptop_platform_remove(); - kfifo_free(&fujitsu_laptop->fifo); + kfifo_free(&priv->fifo); return 0; }