Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp495549ybf; Sat, 29 Feb 2020 08:20:00 -0800 (PST) X-Google-Smtp-Source: ADFU+vsBJ2/XE7aefGdLo7idPAgaMaN1+Nefbj5jd/4iBLwY/vLzTTMh9V9bIlijbep+g/d2WKTt X-Received: by 2002:a9d:66d9:: with SMTP id t25mr929080otm.92.1582993200777; Sat, 29 Feb 2020 08:20:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1582993200; cv=pass; d=google.com; s=arc-20160816; b=0t5SkmGR8wwbHVFpoC7kWAIKMZddy5jRCHCWxLdLPsku8i/dr5LtXMl3Euf2A56obe wUR6PbiXftYCJ5SkVh1hI0Uux3vO9mP6ZUnwMUX2oGz+MHZhnfS1xyVP0A0M7bJ46Csq eStFgpeG9x8r5UhTCrWKgjnbtOlH5yX30F+QOcN1VD9IgDRiKpdDLbDhWcMD4/zgKDiT qQIgZGRYsJcjAhQneyLd0X7RjqDyk6mOzYYiD82a/PoX/3bkMbELMkF/MXIYqe1+9dKx CQDSBcffvYV403iGdX9MNq0nw+VgVy7nvmgFgkfO7dVDXifZLFb+9FyVkYVXI/8RIjJ2 38eg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6Dx1t2RQ5/QjbB15WBRYNhP5FjeKTDD/gThb77QhS8w=; b=j2jBbWprKJP1aee9JFEwNBYj4Fd3P4jgsSnhjnwqFu9xJdesYHYayMYVpU0j5KE9s1 uKNKIH2hOXamVhbaqYDY4K/67wwRBkAYO5Yc3URtDB8BsONj+647RT7+AFEZOSDgcaRV 7d09Tw8UZzEnPeC1E1OcrciKAC8hDxPlrLF0jAxmw6rUb7iS22o4fScUKUn8xSkSazsT bRPAuW3sH2aaJ5R2qxrRoWXLs+rm9j9f9N2X/ta+wrqG7825LCJjGRMYo95gLVyXI3sN 4RCtdDZbKeilWT54ZK0OhxQCmJ8o+OkOj/PrTXvz0z/7Q4eZ7hHDnpzCquedqk1ctIHe DHAQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toradex.com header.s=selector2 header.b=SOoitiHJ; arc=pass (i=1 spf=pass spfdomain=toradex.com dkim=pass dkdomain=toradex.com dmarc=pass fromdomain=toradex.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=toradex.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si3704485oic.205.2020.02.29.08.19.49; Sat, 29 Feb 2020 08:20:00 -0800 (PST) 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=@toradex.com header.s=selector2 header.b=SOoitiHJ; arc=pass (i=1 spf=pass spfdomain=toradex.com dkim=pass dkdomain=toradex.com dmarc=pass fromdomain=toradex.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=toradex.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727359AbgB2QTS (ORCPT + 99 others); Sat, 29 Feb 2020 11:19:18 -0500 Received: from mail-am6eur05hn2202.outbound.protection.outlook.com ([52.101.152.202]:18118 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727137AbgB2QTQ (ORCPT ); Sat, 29 Feb 2020 11:19:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ADsCManT+AainKl5i9X5+zvHTTKmkjep1WstFvYF3Z7P9j+bnB2peB0o+7hxwqaeeucjY5M3Jpx/YAkpplJWg590GSPU0kpnGWnzeNN0qiGs3Sg26QwCuoG1jw8/aBNodIWA0zKDOVKo1RurTP4ukGbzyIg4esPyhuhHklnLpPED2J57va60XFtE+WwXX5+7GeR0pJt6gXDihsfh6Az5I7+0KRFHpY2UJXmm1nfyeT8YQIF3dwQxVP8K0MdR5agVbp1TK4Vw18/5ZVcVT7uo4eG1P+ZD5/pzM5sRNdeoip4kpuhBRh9d5iYLFOyaqzewC4jy8qAjHRr39vFeoGJauA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6Dx1t2RQ5/QjbB15WBRYNhP5FjeKTDD/gThb77QhS8w=; b=A1wgGaeFA+FDueU6emPnUqjlxodUPie+mRlKQn+TSe7Xd4zBGBgsWusvJyztpTByMiK8024T+SVjvux/p2OfXozF5DQ+pZpMdpfBOfcaKwPmo8kc7EZngCWLVetlvZSEvfnL2+UZc6FKJjvWRuQVmEILK2p3EqhLSHb7vWoc46nCRk5jkzCBN13m5RIIbjFrGZ9ZjEF6JwZluu0gmO13GqcH8IOmamJHe6aamPlHsdT9CvI2t6Sf2/Wcr/QpgZ0T7s74lRXW68rTKHWKdEmYT5E+AeVnSOlpQMO+/hJwKlRtY2Vbi7CjWQGk+nIiCiTNCp8AG/m9Ijis94MW2+j3zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=toradex.com; dmarc=pass action=none header.from=toradex.com; dkim=pass header.d=toradex.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6Dx1t2RQ5/QjbB15WBRYNhP5FjeKTDD/gThb77QhS8w=; b=SOoitiHJl3qfLD06jxOknqG4uY10uDvLrRpR7be/7OMNRN8cBgZfPanRwZpjiypcApv4bVRX+CDTingvODuGPhSZxPgciaBX+UzgBO1s/nGfy3bjmlePsJfeP6ubEkaAsSjJjIDvsthjaJvvW8VGWk1W3xzKbHmMidRZLvCvZns= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=oleksandr.suvorov@toradex.com; Received: from VI1PR05MB3279.eurprd05.prod.outlook.com (10.170.238.24) by VI1PR05MB5581.eurprd05.prod.outlook.com (20.177.202.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.15; Sat, 29 Feb 2020 16:18:58 +0000 Received: from VI1PR05MB3279.eurprd05.prod.outlook.com ([fe80::c14f:4592:515f:6e52]) by VI1PR05MB3279.eurprd05.prod.outlook.com ([fe80::c14f:4592:515f:6e52%7]) with mapi id 15.20.2772.012; Sat, 29 Feb 2020 16:18:58 +0000 From: Oleksandr Suvorov To: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Oleksandr Suvorov , Oleksandr Suvorov , Marcel Ziswiler , Igor Opaniuk , Philippe Schenker , Mark Brown Subject: [PATCH 2/2] spi: spidev: fix speed setting message Date: Sat, 29 Feb 2020 18:18:41 +0200 Message-Id: <20200229161841.89144-3-oleksandr.suvorov@toradex.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200229161841.89144-1-oleksandr.suvorov@toradex.com> References: <20200229161841.89144-1-oleksandr.suvorov@toradex.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PR3P191CA0046.EURP191.PROD.OUTLOOK.COM (2603:10a6:102:55::21) To VI1PR05MB3279.eurprd05.prod.outlook.com (2603:10a6:802:1c::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost (194.105.145.90) by PR3P191CA0046.EURP191.PROD.OUTLOOK.COM (2603:10a6:102:55::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18 via Frontend Transport; Sat, 29 Feb 2020 16:18:58 +0000 X-Mailer: git-send-email 2.24.1 X-Originating-IP: [194.105.145.90] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5970205-fb10-4aad-7135-08d7bd3314cf X-MS-TrafficTypeDiagnostic: VI1PR05MB5581:|VI1PR05MB5581: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-Forefront-PRVS: 03283976A6 X-Forefront-Antispam-Report: SFV:SPM;SFS:(10019020)(4636009)(366004)(376002)(396003)(346002)(39840400004)(136003)(199004)(189003)(478600001)(2906002)(54906003)(86362001)(5660300002)(4326008)(36756003)(1076003)(316002)(6486002)(44832011)(8936002)(81166006)(81156014)(8676002)(66556008)(956004)(2616005)(15650500001)(6666004)(66476007)(4744005)(6496006)(52116002)(16526019)(186003)(26005)(66946007)(23200700001);DIR:OUT;SFP:1501;SCL:5;SRVR:VI1PR05MB5581;H:VI1PR05MB3279.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1;CAT:OSPM; Received-SPF: None (protection.outlook.com: toradex.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PonE2eLV5muMcgyLZqXR0BfigvXrP94VQbYNml2ZKREIGc5ZZM7CtHTA2nbqLJxaZSz8EW2FeGEjALY7FFUbx8+9Qf18JCdEC5qPWiNVcNBOP5Br1T6MdcPs8dJbN9JMiGjlWJBgJaCvuEAeLBJg7l/7SUipFkLE9rMM9OOUADwWE58M+c5Osou9pgDwvaqXIwWpqWwgVLW/L34RRqmDuRMj97eUt7mgh2KnfmNsWbn2xetLINYz14NlYlpsenAiWUOcXUsLM9mawFExiJfPGPdNMFko4DbW0fIdHJswZhBrrPRtEy5UHm6Xnwmu1rsBTJq3xOLwLmdApc7WCxy0aqZzA0X6Om+vouniVFe1fKMV6WnYHFYXYbHhJhl3HNnRxMNIwj3Pbjv/xXCCet7CHi/Y4eLib0S5cHkHSoki/aJKxgwXGQfAYYXZN5kBCB0NGVR062XgtnbakrB5rwMUVKYPs0YZD0zZWl+dI8txT3E7yeGwYyB5PACGTd5Q89aBWZ3oWDl6zGCnWgqA9w9dIt8wtcfnOpkBXaJemOhU+2kFMHRCGpeIOwTAs/mHQVSQHZ6JAL6WXcqsgRKIAnOZlrsB7sJg4rIKHy0ajRKfScBiP/DSMZd+0Z1A2X9+PzdfP+DjNcg6kYzu18YGKaseba1daSZE9csgeJ+ItqBbJ5dBC2HmH3wW6DqMBydHK9FNXekbI2zLzmg/FhnoIaAIAFMFZzWmQxPMmAjE3zQhLj7gs0CXodyUB6tntmOvPDpqKBaS6tasbxLN6HkFepxpFw== X-MS-Exchange-AntiSpam-MessageData: mM6CnhwY5KrMAmGrpfUrKGXks37vU7p50Z0KmKbYH1e1VUqLMYxTDO6+5prQ/rVV4g9faiWBvpMw+7L98UoyH/0kD8vU16ew8Bc9VYglK7p1edwYt8blk2GGd9OGxr0YOtgzBW7F7+5KUd1d7gTV7Q== X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5970205-fb10-4aad-7135-08d7bd3314cf X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2020 16:18:58.7844 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5RYYPfL2233vSHlXRa8baqZsGI8iOMqDMYUF3keOaS6eJFmm/condYtdK8WF/fl9ITTC8qqtiPdxJXfdLD/Nifeby0GPyafeEWwLlFLb6Q8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5581 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The message of max device speed setting is shown when an error in spi_setup() occurs. Instead, it should be shown when the setup call succeeds. Signed-off-by: Oleksandr Suvorov --- drivers/spi/spidev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index c97e853dbf5c..80dd1025b953 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -454,10 +454,11 @@ spidev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) spi->max_speed_hz = tmp; retval = spi_setup(spi); - if (retval >= 0) + if (retval == 0) { spidev->speed_hz = tmp; - else - dev_dbg(&spi->dev, "%d Hz (max)\n", tmp); + dev_dbg(&spi->dev, "%d Hz (max)\n", + spidev->speed_hz); + } spi->max_speed_hz = save; } break; -- 2.24.1