From patchwork Mon Jul 23 15:02:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanno Zulla X-Patchwork-Id: 10540463 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BEC714BC for ; Mon, 23 Jul 2018 15:02:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29181204FB for ; Mon, 23 Jul 2018 15:02:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C68528CA7; Mon, 23 Jul 2018 15:02:36 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 E065F28C6C for ; Mon, 23 Jul 2018 15:02:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388462AbeGWQEK (ORCPT ); Mon, 23 Jul 2018 12:04:10 -0400 Received: from zoot.epublica.de ([78.46.103.157]:49628 "EHLO zoot.epublica.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388406AbeGWQEK (ORCPT ); Mon, 23 Jul 2018 12:04:10 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by zoot.epublica.de (Postfix) with ESMTP id C899E1841773; Mon, 23 Jul 2018 17:02:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zoot.epublica.de Received: from zoot.epublica.de ([127.0.0.1]) by localhost (zoot.epublica.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uCUtSq-TzuBo; Mon, 23 Jul 2018 17:02:31 +0200 (CEST) Received: from [10.1.0.41] (ip1f103e43.dynamic.kabel-deutschland.de [31.16.62.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zoot.epublica.de (Postfix) with ESMTPSA id E68061841772; Mon, 23 Jul 2018 17:02:30 +0200 (CEST) From: Hanno Zulla Subject: [PATCH v2 0/5] HID: hid-betopff.c: Minor code refactoring To: huangbobupt@163.com Cc: Jiri Kosina , Benjamin Tissoires , linux-input Message-ID: <84e73143-a5da-9e8d-4ec8-ce425e1b4699@hanno.de> Date: Mon, 23 Jul 2018 17:02:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello Huang, hello Benjamin, the code of hid-betopff.c served as my guide when writing a driver for a different gamepad device. Thanks! Benjamin commented a few issues in my new driver that also applied to your driver, so allow me to fix those here, too. This is v2 of my previous patch. It contains a minor reshuffling of the code so that _init() can be folded back into _probe(), which will fix the error handling. Afterwards, devm_kzalloc() is used to make kfree() obsolete. Benjamin, I do not own the gamepad for this driver. My patched version compiles cleanly, but please have a look over it. Thank you, Hanno Reviewed-by: Benjamin Tissoires --- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html