From patchwork Fri Apr 12 13:25:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 10898283 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 E314E1515 for ; Fri, 12 Apr 2019 13:26:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C10D428E82 for ; Fri, 12 Apr 2019 13:26:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF74228EC8; Fri, 12 Apr 2019 13:26:20 +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 863B728E82 for ; Fri, 12 Apr 2019 13:26:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726697AbfDLN0S (ORCPT ); Fri, 12 Apr 2019 09:26:18 -0400 Received: from mga02.intel.com ([134.134.136.20]:23301 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbfDLN0S (ORCPT ); Fri, 12 Apr 2019 09:26:18 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2019 06:26:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,341,1549958400"; d="scan'208";a="291013445" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.155]) by orsmga004.jf.intel.com with ESMTP; 12 Apr 2019 06:26:16 -0700 From: Jarkko Nikula To: linux-spi@vger.kernel.org Cc: Mark Brown , Jarkko Nikula Subject: [PATCH] spi: Remove one needless transfer speed fall back case Date: Fri, 12 Apr 2019 16:25:51 +0300 Message-Id: <20190412132551.2167-1-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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 Falling back to maximum speed of the controller in case of SPI slave maximum speed is not set is needless. It already defaults to maximum speed of the controller since commit 052eb2d49006 ("spi: core: Set max_speed_hz of spi_device default to max_speed_hz of controller"). Signed-off-by: Jarkko Nikula --- drivers/spi/spi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index bf4027b54a19..86a31340ad03 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -3084,8 +3084,6 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message) if (!xfer->speed_hz) xfer->speed_hz = spi->max_speed_hz; - if (!xfer->speed_hz) - xfer->speed_hz = ctlr->max_speed_hz; if (ctlr->max_speed_hz && xfer->speed_hz > ctlr->max_speed_hz) xfer->speed_hz = ctlr->max_speed_hz;