Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1228499rdh; Mon, 25 Sep 2023 06:58:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLWfaOLT7STkPUXZ+4TGRtsUwN/yS7dF5Y9kTUII9B1hnUr2qFXN0M3dKvohUgb7RYpjZn X-Received: by 2002:a05:6358:5916:b0:143:82e0:8cbc with SMTP id g22-20020a056358591600b0014382e08cbcmr6607426rwf.1.1695650283855; Mon, 25 Sep 2023 06:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695650283; cv=none; d=google.com; s=arc-20160816; b=ct1r3I3f5yg76MZ4ijeICJNhqsqXMSAQBgOR11JwemjBmSQHmnUABP28I3jNq9QqI6 l0XYuxPCe6AEylibnfeI55cEed8DjnXS/nu35TIo+OZ961GUdV9FbEoY03k2i7ExQ1rz PULJ8MufGeq9NO6FoxP5Si9oDwXmeFAw/i4PQ5iw8dYmu1s6gRMLhqqOiEK7rRxDEt2b RlMadPxjwLnYdN/vm9Tn+HO5K3icFIToeeqLT+QNE/KIxOwGkAeOdqO6QArRt6KzDZ2Y sl69wu4wnqPgzz4E+bDOZCtzwphA28Ct/G7SNlyq8G33PU8g4J7RwSKbZiwWL2PaBPWK g1sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=z2AK6YnxcWA5kq1NnPfgljwasG1PYWxAhLfeQhTbjbk=; fh=z/uSyYYV8sTLf333+4z2N/LG6xrWlVcGj3ca6oj+rWc=; b=GOzjQiBirK5/SENiRLVIL9OL0bRMdA/JiEoIHARlPk5mNR2Z2iHiqKbBTsW391xAr7 Yp00CFGw7znCQWjXSMovzK9XYBhYQLUundrMwc2niHg0taYyDkFykklEy7IY06W6QQkJ 1hm1WkX1iRdyuo7lnfVd9JzXGmqI+++ot+Kj/PUymVetEl4Wt0WJzvj1sejun5As77Qd bj2X4mCxJ+7R/cmhW3yc031PEMOUHcRrPuw9qs7UgoPfjfJvQ6Mc4UdZ3AqcORsEQ7wn rEBHHXc0oYH4+3cUCKN/0GwpMx+Mu4v8GCpBa7a8CXiT9S3y1i/MJFCu3n13XQAwpZWN jP4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@phytec.de header.s=a4 header.b=RZdzW+L5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u190-20020a6385c7000000b00565e5651c6dsi9588863pgd.766.2023.09.25.06.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 06:58:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=fail header.i=@phytec.de header.s=a4 header.b=RZdzW+L5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 504D78325D3C; Mon, 25 Sep 2023 06:44:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229647AbjIYNoq (ORCPT + 99 others); Mon, 25 Sep 2023 09:44:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230263AbjIYNop (ORCPT ); Mon, 25 Sep 2023 09:44:45 -0400 Received: from mickerik.phytec.de (mickerik.phytec.de [91.26.50.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4036CB3 for ; Mon, 25 Sep 2023 06:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=phytec.de; s=a4; c=relaxed/simple; q=dns/txt; i=@phytec.de; t=1695649476; x=1698241476; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=28PpxXcCjpk33cV4lxB4KctRi94rZLugQvUovFs5/Zg=; b=RZdzW+L50N9vktvglf7SBGehYNm1n+MOPrad16TEKaDVISlVbmLlUlsIjd2RL6mn ozwb60qknI0kQRSAfXuCgayeHfw5Kr0y47qDrdoW2ArG9B8UaTqRZqZIgksEZxoh mjLkNgkGVrWiyFzJRtdC62uzCDNoM7w8qeasmJbnCFE=; X-AuditID: ac14000a-6d65670000001e37-4d-65118ec4a100 Received: from berlix.phytec.de (Unknown_Domain [172.25.0.12]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mickerik.phytec.de (PHYTEC Mail Gateway) with SMTP id FB.51.07735.4CE81156; Mon, 25 Sep 2023 15:44:36 +0200 (CEST) Received: from augenblix2.phytec.de (172.25.0.11) by Berlix.phytec.de (172.25.0.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Mon, 25 Sep 2023 15:44:36 +0200 From: Wadim Egorov To: , , , , , CC: , , , Subject: [PATCH v2] iio: adc: ti_am335x_adc: Fix return value check of tiadc_request_dma() Date: Mon, 25 Sep 2023 15:44:27 +0200 Message-ID: <20230925134427.214556-1-w.egorov@phytec.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.25.0.11] X-ClientProxiedBy: Berlix.phytec.de (172.25.0.12) To Berlix.phytec.de (172.25.0.12) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDLMWRmVeSWpSXmKPExsWyRpKBR/dIn2Cqwd1LfBb/H71mtXjQtIrJ Ysnk+awW8468Y7G4vGsOm8XVB+UWb36cZbKY9fEHq8X/PTvYLbrfqTtweWxa1cnm0d/dwuqx 5M0hVo/t1+Yxexy/sZ3J4/MmuQC2KC6blNSczLLUIn27BK6MRe/kC25wVjx79YG1gfE3excj J4eEgInEg5bTzF2MXBxCAkuYJG4u7mCEcJ4wSiyd+4UJpIpNQF3izoZvrCC2iEAjo8Td22Dd zAJZEju2nmIEsYUFoiQmbroNVs8ioCpx/MoZFhCbV8BCYtWGm6wQ2+QlZl76zg4RF5Q4OfMJ C8QceYnmrbOZIWwJiYMvXoDZQkDxF5eWs8D0Tjv3mhnCDpXY+mU70wRGgVlIRs1CMmoWklEL GJlXMQrlZiZnpxZlZusVZFSWpCbrpaRuYgTFgAgD1w7GvjkehxiZOBgPMUpwMCuJ8P56xpcq xJuSWFmVWpQfX1Sak1p8iFGag0VJnPd+D1OikEB6YklqdmpqQWoRTJaJg1OqgbGbzevf1/Bv 2V/lHBZMMbBf9ddUrSmkPe6YVJXRjE1cZ9bkzJxz4H7I1ytn/vkxpezpq1ngJi5zcs0eBucC hamLQ5a4tu44dYJjZ5gQq0O5VfZXma8dW3m4D7vdeKVUy7nR5f62pk/K0+6b3ZW5UuueuU1u gmSE1TNmx4V6VqIymXY6KrsmcCixFGckGmoxFxUnAgDtYSE7bwIAAA== X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 25 Sep 2023 06:44:43 -0700 (PDT) Fix wrong handling of a DMA request where the probing only failed if -EPROPE_DEFER was returned. Instead, let us fail if a non -ENODEV value is returned. This makes DMAs explicitly optional. Even if the DMA request is unsuccessfully, the ADC can still work properly. We do also handle the defer probe case by making use of dev_err_probe(). Fixes: f438b9da75eb ("drivers: iio: ti_am335x_adc: add dma support") Signed-off-by: Wadim Egorov --- v2: - Update description - Drop line break after Fixes tag - Move decision about optional DMA into probe/caller --- drivers/iio/adc/ti_am335x_adc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index 8db7a01cb5fb..5f8795986995 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -670,8 +670,10 @@ static int tiadc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, indio_dev); err = tiadc_request_dma(pdev, adc_dev); - if (err && err == -EPROBE_DEFER) + if (err && err != -ENODEV) { + dev_err_probe(&pdev->dev, err, "DMA request failed\n"); goto err_dma; + } return 0; -- 2.34.1