From patchwork Sun Aug 6 20:15:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 9884009 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 09492602B6 for ; Sun, 6 Aug 2017 20:16:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAAE42841E for ; Sun, 6 Aug 2017 20:16:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD40828574; Sun, 6 Aug 2017 20:16:37 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 5E7792841E for ; Sun, 6 Aug 2017 20:16:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751353AbdHFUPw (ORCPT ); Sun, 6 Aug 2017 16:15:52 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:34167 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351AbdHFUPw (ORCPT ); Sun, 6 Aug 2017 16:15:52 -0400 Received: by mail-lf0-f49.google.com with SMTP id g25so23092659lfh.1 for ; Sun, 06 Aug 2017 13:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:user-agent:date:to:cc:subject:mime-version :content-disposition; bh=LjBbIJMMx7jYMQ02MxzgG9MYwwg72dPCnB4NjRHLSaw=; b=ZZVTjfQfPZbdkaLDH/KPIdAf+mMPChc1dioDzrP3bhyDxS1iL14Un40yJ1Ul3H/slO x6zO0mvYsttPguCTQJQ+8jtFJ2ZTewyTg5fqBYMRKmsPlEEU1SnTS7Gvd9gxlc9GnCPd FSt1/NK+jeJIDwGEP2jE4ame67X7aRDmWbX4qya1jP0ulJkfhhSL/So4hUqpGG3KM+0V N3g97xAL9UM1Y8iN4ANcaTwOoJ2yoQPxn9aFubnwowUbrGXx3PRN08Y5r26N6Mo7kWcX 0YCGtDfljXYx/QrVduArgvqZUeV5ZcdaEpfcEDzrugpeI8Axyr0sgD8CpHpuBuYa0jiz XfMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:user-agent:date:to:cc:subject :mime-version:content-disposition; bh=LjBbIJMMx7jYMQ02MxzgG9MYwwg72dPCnB4NjRHLSaw=; b=pt7YGHQiHc6KB7MbDnN2LjKez2N81KgQ1ZvzRKYThB7DkppcDo+DejUVKjqoS+usZ8 pUX4j3FgIAX2qSNU7ihL95LW0UY4gEfq6uYKsiNAS+CYIEWTOZfpfr/kO3pl1uQo9zCH //mXU3vylW4r3qtnr13YCLt/Y2hipAXQ/AqME/gXC4n69xvdHoqpCoxLJ2K6jCMZS0U0 F2BjebbGkSLu5a2vYo5GQVOtUJKYWhlT7JpFqDnu5jzp7tAkDjLB+q3kO5SA31M5rXqU eK6ONb1KEqIfVBF/Rv+QANwhoQcfoT0DFoGmcCcRazTISucoc8VUcRezHXtj0srKxYAl 86Vw== X-Gm-Message-State: AHYfb5gtjGZIZscO/Qje99SyohLUff6iTITh1DGfcxjMsCH5lXL6WAeN l26mvNrZePYLM+oq X-Received: by 10.25.233.143 with SMTP id j15mr3091266lfk.64.1502050550772; Sun, 06 Aug 2017 13:15:50 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.85.50]) by smtp.gmail.com with ESMTPSA id o80sm1926619lfk.44.2017.08.06.13.15.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Aug 2017 13:15:49 -0700 (PDT) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Sun, 06 Aug 2017 23:15:46 +0300 Message-Id: <20170806201546.905810410@cogentembedded.com> User-Agent: quilt/0.64 Date: Sun, 06 Aug 2017 23:15:31 +0300 To: Mark Brown , linux-spi@vger.kernel.org Cc: Sergei Shtylyov Subject: [PATCH] spi: use of_property_read_bool() MIME-Version: 1.0 Content-Disposition: inline; filename=spi-use-of_property_read_bool.patch Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use a bit more compact of_property_read_bool() calls instead of the of_find_property() calls -- symmetrically with the of_property_read_u32() calls already done in of_spi_parse_dt(). Signed-off-by: Sergei Shtylyov --- The patch is against the 'for-next' branch of Mark Brown's 'spi.git' repo. drivers/spi/spi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: spi/drivers/spi/spi.c =================================================================== --- spi.orig/drivers/spi/spi.c +++ spi/drivers/spi/spi.c @@ -1532,15 +1532,15 @@ static int of_spi_parse_dt(struct spi_co int rc; /* Mode (clock phase/polarity/etc.) */ - if (of_find_property(nc, "spi-cpha", NULL)) + if (of_property_read_bool(nc, "spi-cpha")) spi->mode |= SPI_CPHA; - if (of_find_property(nc, "spi-cpol", NULL)) + if (of_property_read_bool(nc, "spi-cpol")) spi->mode |= SPI_CPOL; - if (of_find_property(nc, "spi-cs-high", NULL)) + if (of_property_read_bool(nc, "spi-cs-high")) spi->mode |= SPI_CS_HIGH; - if (of_find_property(nc, "spi-3wire", NULL)) + if (of_property_read_bool(nc, "spi-3wire")) spi->mode |= SPI_3WIRE; - if (of_find_property(nc, "spi-lsb-first", NULL)) + if (of_property_read_bool(nc, "spi-lsb-first")) spi->mode |= SPI_LSB_FIRST; /* Device DUAL/QUAD mode */