From patchwork Tue Dec 17 00:10:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gamari X-Patchwork-Id: 3357541 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0F406C0D4A for ; Tue, 17 Dec 2013 00:10:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 44E9A20111 for ; Tue, 17 Dec 2013 00:10:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69C9D2028D for ; Tue, 17 Dec 2013 00:10:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752386Ab3LQAKp (ORCPT ); Mon, 16 Dec 2013 19:10:45 -0500 Received: from mail-qa0-f49.google.com ([209.85.216.49]:44018 "EHLO mail-qa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752379Ab3LQAKn (ORCPT ); Mon, 16 Dec 2013 19:10:43 -0500 Received: by mail-qa0-f49.google.com with SMTP id ii20so2084549qab.15 for ; Mon, 16 Dec 2013 16:10:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=njI9pNmWM90wfR5ooh63P6lU9I7EcbjYZDTFfyTkNY0=; b=Z8ZvGbXmxqkay9LsXlr9QN4A5ca9IUuiIdWeSG6H2yq8MlHrbJ6yxt1KBETLXclKP1 up9Vdgz4LYqNEO88Vqm6Pzo3xngRuDAzro/0IvSjKZJi7QELXRX59Cc6Aiqrn0h7vNDR 4owpnRcDJm6z9KA/j1O6vmt2zAju0wQr0P/cpvMofgKr+daNdHjQeLjJaZHPq1615Qz8 DKj8/8RDxsoVJtubOo+bhZeebYOxHdhSuQMcnMnXlzOxzbQlYeFwsNdjz3UCdFAQy+Cx dwGg1+hZlHTiZPg+wyO3GGTfD6g+GFcmilQf0RnbhIuQgGkCFNaKsf0O6aWZuhmJCmJ5 T6bg== X-Received: by 10.229.219.5 with SMTP id hs5mr16335847qcb.9.1387239043280; Mon, 16 Dec 2013 16:10:43 -0800 (PST) Received: from ben-laptop.hasb.physics.cns (physicsnat56.physics.umass.edu. [128.119.50.38]) by mx.google.com with ESMTPSA id o5sm45204196qeg.2.2013.12.16.16.10.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 16:10:42 -0800 (PST) From: Ben Gamari To: linux-input@vger.kernel.org Cc: Ben Gamari Subject: [PATCH] input: Port rotary_encoder to of_property_read_bool Date: Mon, 16 Dec 2013 19:10:38 -0500 Message-Id: <1387239038-19089-1-git-send-email-bgamari.foss@gmail.com> X-Mailer: git-send-email 1.8.3.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP --- drivers/input/misc/rotary_encoder.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c index f920ba7..52049db 100644 --- a/drivers/input/misc/rotary_encoder.c +++ b/drivers/input/misc/rotary_encoder.c @@ -175,12 +175,9 @@ static struct rotary_encoder_platform_data *rotary_encoder_parse_dt(struct devic pdata->gpio_b = of_get_gpio_flags(np, 1, &flags); pdata->inverted_b = flags & OF_GPIO_ACTIVE_LOW; - pdata->relative_axis = !!of_get_property(np, - "rotary-encoder,relative-axis", NULL); - pdata->rollover = !!of_get_property(np, - "rotary-encoder,rollover", NULL); - pdata->half_period = !!of_get_property(np, - "rotary-encoder,half-period", NULL); + pdata->relative_axis = of_property_read_bool(np, "rotary-encoder,relative-axis"); + pdata->rollover = of_property_read_bool(np, "rotary-encoder,rollover"); + pdata->half_period = of_property_read_bool(np, "rotary-encoder,half-period"); return pdata; }