From patchwork Thu Mar 9 12:11:47 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: 9613221 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 6A8A6602B4 for ; Thu, 9 Mar 2017 12:12:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5568A285FF for ; Thu, 9 Mar 2017 12:12:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48C0028604; Thu, 9 Mar 2017 12:12:52 +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=ham 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 DA168285FF for ; Thu, 9 Mar 2017 12:12:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932262AbdCIMMq (ORCPT ); Thu, 9 Mar 2017 07:12:46 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:34819 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932206AbdCIMMn (ORCPT ); Thu, 9 Mar 2017 07:12:43 -0500 Received: by mail-lf0-f68.google.com with SMTP id v2so4478403lfi.2 for ; Thu, 09 Mar 2017 04:12:42 -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=+hmx0tNoN7HWfp33okjaQ9tVhj25s1ONfiMuZk4Utmc=; b=YVHSHHxcLYHtbkjytdV/e6cr/ejVUb8E/K4LXlmG4TWPdK6jztnzKN5tO5Uot6Ya0Z dYZLyLgkzzh74Ckd9iP+t7mF5N0bauTX897igM5r/Y+HOGY1v2/rx2KhKgn0M1PPDLv/ llhfuJC4rnBpiFz9PXY0yQ0f/3+40SDE6+41A= 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=+hmx0tNoN7HWfp33okjaQ9tVhj25s1ONfiMuZk4Utmc=; b=Yv2LxDzJ6knE41SBKimC6Gd8aPsb/30Z7iwVoU6fu+Rs1vC8ZqueJ73yHW6iVAoPrk UvtCSkgXWGmY0HxmlXdc+hKQwMvG0Kd+k5YTr/1tlTzUYLo8YImhEDAbZONV7utUHSgp xG8RxFnF11va88W2JEgVFfW+EnF9BG+hZrflZ3Z9F1dNpiYl17WSnhX46BAw1peYgQ3V 3rGiP1cm+jiIimQX3Fz7eCNcGxQAbu7XEqFWNbnLv4d4oYqhzROUvHgf4xpPjiERvMmK 1Yz0uj4F5L+3gCB/MTIjgzWX5ybEPnC39PkJP1p/q/STYm3gdw6dNVY9xpKFK5hBunq8 tuDg== X-Gm-Message-State: AMke39l1sGcMUMFr2Xbezp4an9HyTWOQZoRvfI9B4GFP//Hy6S5jzt4ZgxCTOeC3uHCKqA== X-Received: by 10.25.159.16 with SMTP id i16mr3148857lfe.54.1489061561571; Thu, 09 Mar 2017 04:12:41 -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.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 04:12:41 -0800 (PST) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Harald Welte , Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/14] platform/x86: panasonic-laptop: remove sparse_keymap_free() calls Date: Thu, 9 Mar 2017 13:11:47 +0100 Message-Id: <20170309121150.10553-12-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(). As this reduces acpi_pcc_destroy_input() to one line, replace all calls to that function with direct calls to input_unregister_device(). Signed-off-by: Michał Kępień --- drivers/platform/x86/panasonic-laptop.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 59b8eb626dcc..975f4e100dbd 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -520,29 +520,17 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc) if (error) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to register input device\n")); - goto err_free_keymap; + goto err_free_dev; } pcc->input_dev = input_dev; return 0; - err_free_keymap: - sparse_keymap_free(input_dev); err_free_dev: input_free_device(input_dev); return error; } -static void acpi_pcc_destroy_input(struct pcc_acpi *pcc) -{ - sparse_keymap_free(pcc->input_dev); - input_unregister_device(pcc->input_dev); - /* - * No need to input_free_device() since core input API refcounts - * and free()s the device. - */ -} - /* kernel module interface */ #ifdef CONFIG_PM_SLEEP @@ -640,7 +628,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) out_backlight: backlight_device_unregister(pcc->backlight); out_input: - acpi_pcc_destroy_input(pcc); + input_unregister_device(pcc->input_dev); out_sinf: kfree(pcc->sinf); out_hotkey: @@ -660,7 +648,7 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device) backlight_device_unregister(pcc->backlight); - acpi_pcc_destroy_input(pcc); + input_unregister_device(pcc->input_dev); kfree(pcc->sinf); kfree(pcc);