Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1291587ybg; Fri, 18 Oct 2019 15:19:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeO9bhfnzE9LbHdf9YYyugkk3j3hhEGL+33DK0vn+ZuYmZ4cEaGQlUV8VIKcr4dg9+uOZr X-Received: by 2002:a17:906:a38e:: with SMTP id k14mr11190027ejz.253.1571437163689; Fri, 18 Oct 2019 15:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571437163; cv=none; d=google.com; s=arc-20160816; b=lmFvaL0RcRSOKDjWWdsgKyqEYcBCfUOE+Hj/ukeBFhhN3RiIDgRFQpq4hAS8i5ZF6q jh6Apg/E33szh0sUu9xOgO+6QADvXiR6wL/7xXzFkuY6haAl2GiF0nG6OL6GR2RPFsPz qpJUixj9L/ojvTwNkr3NeDaLkUgJ/bFZI1Sj4CKrbSZCYWG2LUdIqOk9/KFsAEbqo2L5 8bp9NV69mP7l2O7pVR/wPjRYsiVzceIZDFEd5JK8tA9rWHPmfIan+YSSMj59rhAkwHv7 8AQRI0jQN6hGWRRsXiuVYEMj4TsnjkGeFSs3hJHTawden2MnvZzs/0G+Px+/rIzzRi1t ABBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4OSh22+yVoEobbB0Q9LQlMfjUGPQ3hQpM1kovi0TTTE=; b=QyYNlnWHghlxZnjebf5oWmyTLpfH1J03lC3hGoEQ/XWZ5Zo1iIj6uLXPIwZEP8nn+Y OsEOE3CHR4zY7tLxIELT7YP6sE5qDRSxra/b8DQzZmHVvNZ/Ds46ikUldDIDQZ1jfCwq CXNR89K27GWSq5qVRRke13MTnstqNJzXhXImXX215U2wwajOHLG3PNmHF4wk1dx/L05q nFVhfSbdgXgIZ60IkYeSfgbT20WKpbJwoCBui4qipOL2KicOX/Gfwi9ugMXrndI3StOP wuKZcp9CVQjirzU8sg1E3xqE526hPrfYfz2ATgTx9CcCzaxsRvPgbT3C4dCJD7GvuEP5 YL1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iu0ojF5y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p38si4817173edc.449.2019.10.18.15.19.01; Fri, 18 Oct 2019 15:19:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iu0ojF5y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503596AbfJQUnt (ORCPT + 99 others); Thu, 17 Oct 2019 16:43:49 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:36784 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502537AbfJQUmm (ORCPT ); Thu, 17 Oct 2019 16:42:42 -0400 Received: by mail-pl1-f193.google.com with SMTP id j11so1706588plk.3; Thu, 17 Oct 2019 13:42:41 -0700 (PDT) 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=4OSh22+yVoEobbB0Q9LQlMfjUGPQ3hQpM1kovi0TTTE=; b=iu0ojF5yyj3dozHSsziE6kH+Gi584zheA4VlOiCemk4AZQxzKgXLvsn48gtIUW07GV NYtO3c3McBZb+y16uZZkbEdrJll5zVPqOfbr5J1eR56JUNnlneb5jM5y8C6jdeGIq1cs KT1paaVMZXfKM6U0JiYRTdC/Dz8ttXYo8QrNgB8/JbxYHcTspL89Pkg2YIjCzOOW98u6 oojuO2+f6cbLTr0MSPVP59KD190L0rNkxCBbN1MLCN+X7HuFaxjBUkkZe7kLmQY3a8Gx 4Q3fZpcz451JoqXgCcOiW3WE+ARX/EbIveS2ZhP9drB2VMozR94DyNlsk+ZlX1Myqqnr 7OfA== 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=4OSh22+yVoEobbB0Q9LQlMfjUGPQ3hQpM1kovi0TTTE=; b=b1hvzDWtkbn79YWU2OKspKEsO4Dx/2k5XUZvRt3gelV3O/DYMLp4UuXoXLncVv3Ugq 0kDLDqdG1NAHeceDnU0d8lw735j0UjO7Pr4KsKd/yoCPmevl0RJpYfzhN41OF9Evv0Ry Ec60+lTxWbcbgVABa/yDl3Cs5vp+bjGqHYHhW39LUlFWQaQfV0kG45k8vs4Ov6rtLKVB 0LL5FVfkDcnIOqriOifVL4tiQrJyYzuE6j6oiV7YHoBmLTfDqWvygRsueIoh+JwORwat EKD/ypCn0qPlS3Uyx/1BdstFlxNimpy0G1Vsgfu9Ra8JgBEQMtVn2b6gICSiHMiWhYHs bN5Q== X-Gm-Message-State: APjAAAULPZHEziLsOI+DIC5/eW5cJNGnzzmNbOlaCtzLqy85tKQTXl4F Pg8Px97G8QsxtbZdBBDViFSYGnZ+ X-Received: by 2002:a17:902:848e:: with SMTP id c14mr5548629plo.77.1571344960154; Thu, 17 Oct 2019 13:42:40 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id b3sm4626365pfd.125.2019.10.17.13.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 13:42:39 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Bartosz Golaszewski , Brian Masney , Luca Weiss , Maximilian Luz , Steve Winslow , linux-kernel@vger.kernel.org Subject: [PATCH 14/22] Input: sgi_btns - switch to using polled mode of input devices Date: Thu, 17 Oct 2019 13:42:08 -0700 Message-Id: <20191017204217.106453-15-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.23.0.866.gb869b98d4c-goog In-Reply-To: <20191017204217.106453-1-dmitry.torokhov@gmail.com> References: <20191017204217.106453-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We have added polled mode to the normal input devices with the intent of retiring input_polled_dev. This converts sgi_btns driver to use the polling mode of standard input devices and removes dependency on INPUT_POLLDEV. Signed-off-by: Dmitry Torokhov --- drivers/input/misc/Kconfig | 1 - drivers/input/misc/sgi_btns.c | 25 +++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 05520bf4e31d..c27a9ee4ef9a 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -543,7 +543,6 @@ config INPUT_UINPUT config INPUT_SGI_BTNS tristate "SGI Indy/O2 volume button interface" depends on SGI_IP22 || SGI_IP32 - select INPUT_POLLDEV help Say Y here if you want to support SGI Indy/O2 volume button interface. diff --git a/drivers/input/misc/sgi_btns.c b/drivers/input/misc/sgi_btns.c index 829277b4271f..0657d785b3cc 100644 --- a/drivers/input/misc/sgi_btns.c +++ b/drivers/input/misc/sgi_btns.c @@ -4,7 +4,7 @@ * * Copyright (C) 2008 Thomas Bogendoerfer */ -#include +#include #include #include #include @@ -49,10 +49,9 @@ struct buttons_dev { int count[ARRAY_SIZE(sgi_map)]; }; -static void handle_buttons(struct input_polled_dev *dev) +static void handle_buttons(struct input_dev *input) { - struct buttons_dev *bdev = dev->private; - struct input_dev *input = dev->input; + struct buttons_dev *bdev = input_get_drvdata(input); u8 status; int i; @@ -79,7 +78,6 @@ static void handle_buttons(struct input_polled_dev *dev) static int sgi_buttons_probe(struct platform_device *pdev) { struct buttons_dev *bdev; - struct input_polled_dev *poll_dev; struct input_dev *input; int error, i; @@ -87,17 +85,14 @@ static int sgi_buttons_probe(struct platform_device *pdev) if (!bdev) return -ENOMEM; - poll_dev = devm_input_allocate_polled_device(&pdev->dev); - if (!poll_dev) + input = devm_input_allocate_device(&pdev->dev); + if (!input) return -ENOMEM; memcpy(bdev->keymap, sgi_map, sizeof(bdev->keymap)); - poll_dev->private = bdev; - poll_dev->poll = handle_buttons; - poll_dev->poll_interval = BUTTONS_POLL_INTERVAL; + input_set_drvdata(input, bdev); - input = poll_dev->input; input->name = "SGI buttons"; input->phys = "sgi/input0"; input->id.bustype = BUS_HOST; @@ -112,7 +107,13 @@ static int sgi_buttons_probe(struct platform_device *pdev) __set_bit(bdev->keymap[i], input->keybit); __clear_bit(KEY_RESERVED, input->keybit); - error = input_register_polled_device(poll_dev); + error = input_setup_polling(input, handle_buttons); + if (error) + return error; + + input_set_poll_interval(input, BUTTONS_POLL_INTERVAL); + + error = input_register_device(input); if (error) return error; -- 2.23.0.866.gb869b98d4c-goog