From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762541AbcALOHy (ORCPT ); Tue, 12 Jan 2016 09:07:54 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35303 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934937AbcALODb (ORCPT ); Tue, 12 Jan 2016 09:03:31 -0500 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Darren Hart , Matthew Garrett , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Richard Purdie , Jacek Anaszewski Cc: Alex Hung , platform-driver-x86@vger.kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/14] dell-laptop: use dell_smbios_find_token() instead of find_token_location() Date: Tue, 12 Jan 2016 15:02:56 +0100 Message-Id: <1452607380-20861-11-git-send-email-kernel@kempniu.pl> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1452607380-20861-1-git-send-email-kernel@kempniu.pl> References: <1452607380-20861-1-git-send-email-kernel@kempniu.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace all uses of find_token_location() with dell_smbios_find_token() to avoid directly accessing the da_tokens table. Signed-off-by: Michał Kępień --- drivers/platform/x86/dell-laptop.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index dfe2afd..4de61b7 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -867,15 +867,15 @@ static void dell_cleanup_rfkill(void) static int dell_send_intensity(struct backlight_device *bd) { - int token; + struct calling_interface_token *token; int ret; - token = find_token_location(BRIGHTNESS_TOKEN); - if (token == -1) + token = dell_smbios_find_token(BRIGHTNESS_TOKEN); + if (!token) return -ENODEV; dell_smbios_get_buffer(); - dell_smbios_buffer->input[0] = token; + dell_smbios_buffer->input[0] = token->location; dell_smbios_buffer->input[1] = bd->props.brightness; if (power_supply_is_system_supplied() > 0) @@ -891,15 +891,15 @@ static int dell_send_intensity(struct backlight_device *bd) static int dell_get_intensity(struct backlight_device *bd) { - int token; + struct calling_interface_token *token; int ret; - token = find_token_location(BRIGHTNESS_TOKEN); - if (token == -1) + token = dell_smbios_find_token(BRIGHTNESS_TOKEN); + if (!token) return -ENODEV; dell_smbios_get_buffer(); - dell_smbios_buffer->input[0] = token; + dell_smbios_buffer->input[0] = token->location; if (power_supply_is_system_supplied() > 0) dell_smbios_send_request(0, 2); @@ -1973,8 +1973,8 @@ static void kbd_led_exit(void) static int __init dell_init(void) { + struct calling_interface_token *token; int max_intensity = 0; - int token; int ret; if (!dmi_check_system(dell_device_table)) @@ -2016,10 +2016,10 @@ static int __init dell_init(void) if (acpi_video_get_backlight_type() != acpi_backlight_vendor) return 0; - token = find_token_location(BRIGHTNESS_TOKEN); - if (token != -1) { + token = dell_smbios_find_token(BRIGHTNESS_TOKEN); + if (token) { dell_smbios_get_buffer(); - dell_smbios_buffer->input[0] = token; + dell_smbios_buffer->input[0] = token->location; dell_smbios_send_request(0, 2); if (dell_smbios_buffer->output[0] == 0) max_intensity = dell_smbios_buffer->output[3]; -- 1.7.10.4