From patchwork Fri Jan 22 14:27:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= X-Patchwork-Id: 8090431 Return-Path: X-Original-To: patchwork-platform-driver-x86@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1E3859F859 for ; Fri, 22 Jan 2016 14:28:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30F12203A1 for ; Fri, 22 Jan 2016 14:28:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45093203F3 for ; Fri, 22 Jan 2016 14:28:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754190AbcAVO23 (ORCPT ); Fri, 22 Jan 2016 09:28:29 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:33257 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754106AbcAVO15 (ORCPT ); Fri, 22 Jan 2016 09:27:57 -0500 Received: by mail-lf0-f67.google.com with SMTP id z62so4198648lfd.0 for ; Fri, 22 Jan 2016 06:27:56 -0800 (PST) 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-type:content-transfer-encoding; bh=mlMJC/ly6x8MnjLyYt8pIDJQRnthftZWmkLDyICgTxQ=; b=MLh0wzQAK+hTaTkGqAN+fg7bhxqlFQAiOaIj2P3jLU6enl/9xwD3/bfdd68Pu5J7zt P0F4apomhUuVT44Ga2L53R+5quTdEybbNrEc3qxNJakkpCDmV7Ump8Un314Y+raBdmtM uLetjSYRpc66lkW1UKZIUuf0xVTIVfmSBx6HA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=mlMJC/ly6x8MnjLyYt8pIDJQRnthftZWmkLDyICgTxQ=; b=iWqN0oDlGh4EOyP5YTssZx+m+k3u/J32S/+RK+W/4WLaQE/Lx1fYvwhVqkuy5dirj1 ZfQJg3V1F/ilZF6MM1LaqcOClGCK9WHRIR9t/L9U6jfVRUq0w8AR+UgUwhyOWnGt5sPE fOypVl9EuLJR7F+NDxIV1vMnlkOZbuur4T64Yv3TDDbtOTTep+yGVPumbVQH5aor0Vq2 qUhxEcjy2GqfCYrjCpFq8eweEvB9aWvG0j0mPM99dvdZ+JGMLx6snnqkUal5kaDIWtll Rw0mqut17oFrFq2XaFRWmKmVR0F2s8wm/tY4nj56RBBE9jIHTojogPh95B4yB9KvDh3t 8A2Q== X-Gm-Message-State: AG10YOS6zyOyRa2EoKTlLG0UuLAPbIVP1QduTayo0MZJBY5hE3SwK58H2unIT2alHfhqWg== X-Received: by 10.25.90.13 with SMTP id o13mr1416643lfb.114.1453472875827; Fri, 22 Jan 2016 06:27:55 -0800 (PST) Received: from eudyptula.hq.kempniu.pl. (eudyptula.hq.kempniu.pl. [2001:6a0:200:83b0::fd5a]) by smtp.googlemail.com with ESMTPSA id o82sm912027lfo.47.2016.01.22.06.27.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2016 06:27:54 -0800 (PST) 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: platform-driver-x86@vger.kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 12/16] dell-laptop: use dell_smbios_find_token() instead of find_token_location() Date: Fri, 22 Jan 2016 15:27:24 +0100 Message-Id: <1453472848-3118-13-git-send-email-kernel@kempniu.pl> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1453472848-3118-1-git-send-email-kernel@kempniu.pl> References: <1453472848-3118-1-git-send-email-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-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 4d1694d..76064c8 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -874,15 +874,15 @@ static void dell_cleanup_rfkill(void) static int dell_send_intensity(struct backlight_device *bd) { struct calling_interface_buffer *buffer; - 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; buffer = dell_smbios_get_buffer(); - buffer->input[0] = token; + buffer->input[0] = token->location; buffer->input[1] = bd->props.brightness; if (power_supply_is_system_supplied() > 0) @@ -899,15 +899,15 @@ static int dell_send_intensity(struct backlight_device *bd) static int dell_get_intensity(struct backlight_device *bd) { struct calling_interface_buffer *buffer; - 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; buffer = dell_smbios_get_buffer(); - buffer->input[0] = token; + buffer->input[0] = token->location; if (power_supply_is_system_supplied() > 0) dell_smbios_send_request(0, 2); @@ -1987,8 +1987,8 @@ static void kbd_led_exit(void) static int __init dell_init(void) { struct calling_interface_buffer *buffer; + struct calling_interface_token *token; int max_intensity = 0; - int token; int ret; if (!dmi_check_system(dell_device_table)) @@ -2030,10 +2030,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) { buffer = dell_smbios_get_buffer(); - buffer->input[0] = token; + buffer->input[0] = token->location; dell_smbios_send_request(0, 2); if (buffer->output[0] == 0) max_intensity = buffer->output[3];