From patchwork Tue Jul 13 09:31:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 111736 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6D9VEwU018330 for ; Tue, 13 Jul 2010 09:31:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754859Ab0GMJaq (ORCPT ); Tue, 13 Jul 2010 05:30:46 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:33765 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752600Ab0GMJao (ORCPT ); Tue, 13 Jul 2010 05:30:44 -0400 Received: by iwn7 with SMTP id 7so5649992iwn.19 for ; Tue, 13 Jul 2010 02:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=bdcXJRlB7fWQQqsMsCO8Huk5uDa3oCTGF9l755zZufk=; b=nwXmvUpqghwtJBYmAodk7sUE3UF7n5qMWuhB0EADLGQxOSAhaN0iLRR72cwMJIBXyn 1WnP9av9/575SPrAFLzKhAzTJsyFvCBedGFljxPgc9YKQ4AFV2lKs3n3Ohcl/ohuZJbf GKumkvXf4NbtaAXurbGO2m/N4uPkdYhfUjwJI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=NHjE+Pqltc+tx2QA6ALjz5js+j8vjVbPHgVzwAVszYgrnv+HKvMNRv6eh8Ki63b+bm B324NKqZY4OGjMFsTWfl6vRZ+1zR13K2moqXQ0N9/yE3NW5qiZEhWjpKiG9fCxead6R4 Kqpd9/wv8vmOSb5mffhFH4OLM00SZMU2JBXxQ= Received: by 10.42.9.73 with SMTP id l9mr4953149icl.74.1279013443557; Tue, 13 Jul 2010 02:30:43 -0700 (PDT) Received: from [192.168.100.50] (60-251-136-127.HINET-IP.hinet.net [60.251.136.127]) by mx.google.com with ESMTPS id g31sm24184546ibh.16.2010.07.13.02.30.39 (version=SSLv3 cipher=RC4-MD5); Tue, 13 Jul 2010 02:30:43 -0700 (PDT) Subject: [PATCH] atlas_btns: fix mixing acpi_status and int for return value From: Axel Lin To: linux-kernel Cc: Dmitry Torokhov , Lin Ming , linux-input@vger.kernel.org Date: Tue, 13 Jul 2010 17:31:15 +0800 Message-Id: <1279013475.28550.5.camel@mola> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 13 Jul 2010 09:31:17 +0000 (UTC) diff --git a/drivers/input/misc/atlas_btns.c b/drivers/input/misc/atlas_btns.c index 7d53608..ea14800 100644 --- a/drivers/input/misc/atlas_btns.c +++ b/drivers/input/misc/atlas_btns.c @@ -60,12 +60,12 @@ static acpi_status acpi_atlas_button_handler(u32 function, input_report_key(input_dev, atlas_keymap[code], key_down); input_sync(input_dev); - status = 0; + status = AE_OK; } else { printk(KERN_WARNING "atlas: shrugged on unexpected function" ":function=%x,address=%lx,value=%x\n", function, (unsigned long)address, (u32)*value); - status = -EINVAL; + status = AE_BAD_PARAMETER; } return status; @@ -114,26 +114,27 @@ static int atlas_acpi_button_add(struct acpi_device *device) if (ACPI_FAILURE(status)) { printk(KERN_ERR "Atlas: Error installing addr spc handler\n"); input_unregister_device(input_dev); - status = -EINVAL; + err = -EINVAL; } - return status; + return err; } static int atlas_acpi_button_remove(struct acpi_device *device, int type) { acpi_status status; + int err = 0; status = acpi_remove_address_space_handler(device->handle, 0x81, &acpi_atlas_button_handler); if (ACPI_FAILURE(status)) { printk(KERN_ERR "Atlas: Error removing addr spc handler\n"); - status = -EINVAL; + err = -EINVAL; } input_unregister_device(input_dev); - return status; + return err; } static const struct acpi_device_id atlas_device_ids[] = {