From patchwork Fri May 19 07:44:41 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: 9736139 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 7F9C06034C for ; Fri, 19 May 2017 07:46:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76964288D0 for ; Fri, 19 May 2017 07:46:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B68E288D2; Fri, 19 May 2017 07:46:56 +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=unavailable 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 E46CD2881B for ; Fri, 19 May 2017 07:46:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753443AbdESHqm (ORCPT ); Fri, 19 May 2017 03:46:42 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33101 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751145AbdESHo4 (ORCPT ); Fri, 19 May 2017 03:44:56 -0400 Received: by mail-wm0-f65.google.com with SMTP id b84so545783wmh.0 for ; Fri, 19 May 2017 00:44:56 -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=kgOQJcmt3MzQZn5NP/5mtNYtC7iy4IJ1DrWqnIIh4Hg=; b=qh4mVMyY+/MFu/iHpTPzR9MobxudNzxZQHBSOkItORyrmWWthUQrFfI9mlQpBPCjLF bhdNbGCYP4AoTpeNEr5+gjvHakawWUxFCuqr8EDpRa/wmFh810pqbP/VJoc4JHJnkyS9 WgjpoHcKKvypRrx+lVQTt87lwxUWgmEQ4DA/w= 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=kgOQJcmt3MzQZn5NP/5mtNYtC7iy4IJ1DrWqnIIh4Hg=; b=hyVvvxvBhlmhrPFJNbMUpdFBVcMQNeGKnacISsw+8Tfuj8g3sGSMOs+r1OntwdMOk0 IcVGHE/8GjGGnPUvtFa+rIYj9XtpoZxUwNgXoZebXi3LIz9ncnYKSFi0NRW8PvQkU1XA 2zyU7i/DCDlmjKt8CULcRN/ymBsOqEmet+8VVtYlzsNJ05eZVZMU4oE+2CaGqwdRSuKs LjGgnpvmb1kF3WdHr/9828FMek63gNxuMjWA29Fd84q4yDH1SrBMABn22h+o8lAGX65Y hXrWURABSxGrRwBHRV8AQpzG0d6Ebw3ycR1KgnC/Q+cfNtqvg5yFf6Ebe9aYHyLbvDE7 WYOA== X-Gm-Message-State: AODbwcBiV7BnJgsxG0bGVxLUXMDWkgl56qeVcfObpkAt7jemWB1AT55G DRKLEGGF1FcIIOgf X-Received: by 10.25.125.133 with SMTP id y127mr1772694lfc.12.1495179895197; Fri, 19 May 2017 00:44:55 -0700 (PDT) Received: from ozzy.nask.waw.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id a1sm811623lfb.15.2017.05.19.00.44.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2017 00:44:54 -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 v2 1/8] platform/x86: fujitsu-laptop: distinguish current uses of device-specific data Date: Fri, 19 May 2017 09:44:41 +0200 Message-Id: <20170519074448.12716-2-kernel@kempniu.pl> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170519074448.12716-1-kernel@kempniu.pl> References: <20170519074448.12716-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 7f49d92914c9..024ef339179a 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -348,26 +348,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) @@ -541,27 +541,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) @@ -863,11 +863,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; }