From patchwork Thu Mar 9 12:11:39 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: 9613247 X-Patchwork-Delegate: andy.shevchenko@gmail.com 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 89E2C602B4 for ; Thu, 9 Mar 2017 12:14:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 788AC285CE for ; Thu, 9 Mar 2017 12:14:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D802285FF; Thu, 9 Mar 2017 12:14:53 +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 2544E28601 for ; Thu, 9 Mar 2017 12:14:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754727AbdCIMMZ (ORCPT ); Thu, 9 Mar 2017 07:12:25 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36654 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754641AbdCIMMV (ORCPT ); Thu, 9 Mar 2017 07:12:21 -0500 Received: by mail-lf0-f67.google.com with SMTP id g70so4454360lfh.3 for ; Thu, 09 Mar 2017 04:12:15 -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-transfer-encoding; bh=eqXgpCP1j0VOe2Lsn6OooM3JfXDVYrBdydOqOEaMEpo=; b=s4//mneAvYPDl+GQPxO7qnuo7pdLaxmforxjLvNuDVFKS1uQuyaRQ6hEJ/W4cFvLZu cfM1gJKFWvN5CIN29e7mL0aprYCIsbcRxzKUzt8tpLASK/dj2EnDqg6MC0HjwFJBXX91 h5jDZhd2M0M3xH+9jRXaJmkSJcykQmQhSQVgg= 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=eqXgpCP1j0VOe2Lsn6OooM3JfXDVYrBdydOqOEaMEpo=; b=XHzId9leFSrpqTPSRU2Y7W5PppHGy3Qg9KDIot/Vk5je6XUeUaSNy6K/SnSGFXWaQg 6vr58RgcqJksoT4hYmVjAZ7jfxh+Lo+2KHBGh199SMxiVbbn6G+e8i++Ad727cYvS7HA kTpGRjtpYZqZwmVQjnGeQPLREvsTr2Xwf5I6P9Irek2PNMuXyUn0hLyhTnUV0JeC+KZJ KyijjFeq/ej22RSgUw0kQMkUOtPLXMmuk33TmpUkGPrUSkWt4NbiJqGETkqOD3Zkd86S OgvJHOH5jR94WCMkdGKEjWqyH9HqWhJbSYXmqXYh6GZw3A8Vr99u7n6YwDEZZfPLFAJi i+6A== X-Gm-Message-State: AMke39lYdo9lWxIWznQEcutvrylXhGJmBDwPY3FRXD6aWfV5AiaLCbxMfLiBvEatd6IATw== X-Received: by 10.25.44.16 with SMTP id s16mr3219653lfs.6.1489061534756; Thu, 09 Mar 2017 04:12:14 -0800 (PST) Received: from ozzy.nask.waw.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id o91sm1247952lfg.1.2017.03.09.04.12.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 04:12:14 -0800 (PST) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Corentin Chary , Darren Hart , Andy Shevchenko Cc: acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/14] platform/x86: asus-wmi: remove sparse_keymap_free() calls Date: Thu, 9 Mar 2017 13:11:39 +0100 Message-Id: <20170309121150.10553-4-kernel@kempniu.pl> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170309121150.10553-1-kernel@kempniu.pl> References: <20170309121150.10553-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 As sparse_keymap_setup() now uses a managed memory allocation for the keymap copy it creates, the latter is freed automatically. Remove all calls to sparse_keymap_free(). Signed-off-by: Michał Kępień --- drivers/platform/x86/asus-wmi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 8fe5890bf539..d817e6327fec 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -269,12 +269,10 @@ static int asus_wmi_input_init(struct asus_wmi *asus) err = input_register_device(asus->inputdev); if (err) - goto err_free_keymap; + goto err_free_dev; return 0; -err_free_keymap: - sparse_keymap_free(asus->inputdev); err_free_dev: input_free_device(asus->inputdev); return err; @@ -282,10 +280,8 @@ static int asus_wmi_input_init(struct asus_wmi *asus) static void asus_wmi_input_exit(struct asus_wmi *asus) { - if (asus->inputdev) { - sparse_keymap_free(asus->inputdev); + if (asus->inputdev) input_unregister_device(asus->inputdev); - } asus->inputdev = NULL; }