From patchwork Sun Feb 10 10:14:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolai Kondrashov X-Patchwork-Id: 10804703 X-Patchwork-Delegate: jikos@jikos.cz 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 02F7517E6 for ; Sun, 10 Feb 2019 10:15:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E96CF29F46 for ; Sun, 10 Feb 2019 10:15:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDE5629F45; Sun, 10 Feb 2019 10:15:11 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 9354B29F46 for ; Sun, 10 Feb 2019 10:15:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726134AbfBJKPL (ORCPT ); Sun, 10 Feb 2019 05:15:11 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34176 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbfBJKPK (ORCPT ); Sun, 10 Feb 2019 05:15:10 -0500 Received: by mail-lj1-f194.google.com with SMTP id v14-v6so6480772ljv.1 for ; Sun, 10 Feb 2019 02:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LVE1oFlzcZeUSefYKw5QtqSf97EomnbNHWcuBBpGajI=; b=ikHvld3OvaFCUkNl7oAlUlJl9oRoSA+DvycihsqpzISBkLZ2VGfSAKTb86BjZneF2g 1+JpTU6Q6hEv39jw5a1NANzCna7n80G0hCwN4Qbpvfq1mOhWPtNu1h1wu3u5bL3dzgQU O44ElkbUyfQge1yAwOslDmDZeYZ6SNNfMXMxymhx4fN/x9WA4BJTe5IYfB98NPgeIapn blJpNTujU6o0ZxG9vFKT7tmoS584zvHVPhxlNWw0gjKDUjJPOlBTbHU4PtQb5frVMI7L wbZnpgMaStTLyFTgo+hCZHEHy9+Agh7Wqo/JAyN44e6HzgyMtP8rCcEjYMTeP12AuYmy BdtA== 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=LVE1oFlzcZeUSefYKw5QtqSf97EomnbNHWcuBBpGajI=; b=Z7E0a2oGegLdG2LXY2mCLMP/S5c7sVCC181nr/uqpCIbyAWHioVKZBT7gPiWZIqHBB xWnV25uPPngrvzOOmvdqdKRPBI0xblRjnDbxtm0oncrVs/sJS8fMhqDNJUoKoEfT6tnY qZ5Ow8N4v68VFM43yPQ6lI2wkAO4kEatnzWvTvfoXKcQ6vcly51869BrJj788L60QqFK 6C35o0baIiFG1+UuebyYG9Q8xFVDTdu3TDjyeAQA6O6fmiQy+G+H6MaiqkacksRS4csp l0wSimU4IVxsOdIn+WrHbyQL8AbkkgZqe1EGla/HZz0GJU6LCUP8h3WkyLq0iSeUkZAH ZhCg== X-Gm-Message-State: AHQUAuaXwftztfJ6otqBRDZObnRIgQ6llJ25eC7JBRS/e6m0J4vf+C3f 3x9PQQu5Aa3tdKLstfvCKbg= X-Google-Smtp-Source: AHgI3IYoQ9dVmSl8PN0b4wGUct2VvAAOs9RbgdcLnYdnzD0eqyS1nExQqbGwiPL6snQh1ppAN29rZA== X-Received: by 2002:a2e:549:: with SMTP id 70-v6mr1560236ljf.196.1549793708686; Sun, 10 Feb 2019 02:15:08 -0800 (PST) Received: from bard.ponomarevs.fi (88-112-122-53.elisa-laajakaista.fi. [88.112.122.53]) by smtp.gmail.com with ESMTPSA id l21-v6sm1472010ljj.48.2019.02.10.02.15.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 02:15:07 -0800 (PST) From: Nikolai Kondrashov To: Benjamin Tissoires Cc: Jiri Kosina , linux-input@vger.kernel.org, Nikolai Kondrashov Subject: [PATCH v2 20/23] HID: uclogic: Do not initialize non-USB devices Date: Sun, 10 Feb 2019 12:14:06 +0200 Message-Id: <20190210101409.3511-21-spbnick@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190210101409.3511-1-spbnick@gmail.com> References: <20181227171625.11164-1-spbnick@gmail.com> <20190210101409.3511-1-spbnick@gmail.com> MIME-Version: 1.0 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 Do not try to initialize UC-Logic tablets if the underlying device is not a USB device, but e.g. a uhid device. Signed-off-by: Nikolai Kondrashov --- drivers/hid/hid-uclogic-params.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c index b582739a570a..7710d9f957da 100644 --- a/drivers/hid/hid-uclogic-params.c +++ b/drivers/hid/hid-uclogic-params.c @@ -826,7 +826,8 @@ static int uclogic_params_huion_init(struct uclogic_params *params, * uclogic_params_cleanup()). Not modified in case of error. * Cannot be NULL. * @hdev: The HID device of the tablet interface to initialize and get - * parameters from. Cannot be NULL. + * parameters from. Cannot be NULL. Must be using the USB low-level + * driver, i.e. be an actual USB tablet. * * Returns: * Zero, if successful. A negative errno code on error. @@ -844,7 +845,8 @@ int uclogic_params_init(struct uclogic_params *params, struct uclogic_params p = {0, }; /* Check arguments */ - if (params == NULL || hdev == NULL) { + if (params == NULL || hdev == NULL || + !hid_is_using_ll_driver(hdev, &usb_hid_driver)) { rc = -EINVAL; goto cleanup; }