From patchwork Mon Jan 6 08:49:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13927081 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE667E77188 for ; Mon, 6 Jan 2025 08:50:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A6F7210E5CC; Mon, 6 Jan 2025 08:50:18 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="iKuxI2sV"; dkim-atps=neutral Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6FFF810E5CA for ; Mon, 6 Jan 2025 08:50:16 +0000 (UTC) Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-aa6965ad2a5so151366566b.3 for ; Mon, 06 Jan 2025 00:50:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736153355; x=1736758155; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ywLej3GM0KyKJnGRMRgcFZSn6sceBNpXrAUD1YJ/g44=; b=iKuxI2sVpZiOvsxdon+lJK24vCdZJmXwGQ46Gn9jIZXHYbNQfAAt9pT5YwyDgrioZd 19iZIzfHcRCagg5F5mexj58vHxGB406s7xDUzZmEe6DnzL7348bDwgib7DnAcd6w6moP NWPtA2EBNdacKZ+b01hKU9NLv6I3BW/cIV+UscWv5VGSJjgk8obWFg2OWghROi/0LEXG vC/Cq768sMKY5lgK5G3VyvgyYBn1YxeCj8ycrTigyEfJP0YpLY5ihZs+dGkqheRbyEjq 11cvYyTbTVp92kOljL9oBF/1tzpw8hHDM0bYqw1S9E4LXCJv7fWyd96PKGlabkwupWcl +qfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736153355; x=1736758155; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ywLej3GM0KyKJnGRMRgcFZSn6sceBNpXrAUD1YJ/g44=; b=Y8qPgp6Gc7BwQNqrH76vf6w2A0L869DQIawhlnRtyTl0rHWVzIMc954ZXUheA66dsP dcEmPpfc7qG0YwiuEhtsc/GL8mALbGdT24NQbDCFVKhp2/xTdQiC/FIkQKDDuIv8GUQY axIUg3LRakd8m2f+7YwQoXj3Iu/iwomv9DZFkKDwRhoYzotU/6JHmghxqI8iMJehtC5q oEaENhSWC+xTvDCKQWxyBAIyDlADMeeqAkAvqYOtYTTLUjM+b1cx4MCYcFgFx0KsBZaY 39feX5PFFeoS3itLL0pFj8eFWPukTjzJdttuuntO45NLT8c9xqIkEuMgB9SOLCZpRxUm mXmw== X-Forwarded-Encrypted: i=1; AJvYcCUYUpMW2K3iLObtHuAci2exCOWTi/znt5YzFTxEl/GNP8GpUYX6vb/K2j6lLgowMrHHzYLlA48LrAU=@lists.freedesktop.org X-Gm-Message-State: AOJu0YxF5T+feZDCIXia93hseOWwHWefvCSMYiRNVR4LR+eBInOTk5e8 63drK+vBg0aATP7lscl8xpDmDsmY9J7rEcrwU608oE/E8vj0vazDuv5ws7R+9hQ= X-Gm-Gg: ASbGncsy5fiqX4rfFbOr1+FIeVo6dPlmVNMU9zAzTPWqeW+ryAWDEPzkAfvmNfsRp7B WGTfBMzMf+IcWt+UnWS8lA1iY6nc3rSGQj5R8eQm9mGMiiQKVl9Ez3K+zVA5rHCsaoE6wUgOelr 2NQa/S0HA6GKQtDLFJPkGTAsD5KEYGd+YPJQeW53R14X0z0mq84OkfMs+aj3h1AZ5X4pwSj2/0a gUkg8Hne7cjjuhAN0/A4HsyMk2L6YPuMDCsqE87Xc2CUZ1K61HhOJiXEtJXFkvf/rk3N6gA X-Google-Smtp-Source: AGHT+IHKHcWYf/OgOrf9O3FcoAGEsMn4vt0y96TrbQy13IkeRq/FUB+urbvhws6fwBpAAavMVngICA== X-Received: by 2002:a17:907:7e92:b0:aa6:9631:9222 with SMTP id a640c23a62f3a-aac2874a950mr1828712466b.2.1736153354990; Mon, 06 Jan 2025 00:49:14 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e82f1d2sm2222112466b.11.2025.01.06.00.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 00:49:14 -0800 (PST) From: Krzysztof Kozlowski Date: Mon, 06 Jan 2025 09:49:04 +0100 Subject: [PATCH 1/4] drm/msm/dsi: Drop redundant NULL-ifying of clocks on error paths MIME-Version: 1.0 Message-Id: <20250106-drm-msm-cleanups-v1-1-271ff1c00795@linaro.org> References: <20250106-drm-msm-cleanups-v1-0-271ff1c00795@linaro.org> In-Reply-To: <20250106-drm-msm-cleanups-v1-0-271ff1c00795@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1610; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=PhVBTMK/6+dy3CEy0PY9YFYK561quc3srNdqv8QLMdg=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBne5kEv7KHY56NiTm9j77NT3LYMCJ8uIFoRUbF3 5W2BFiJFq+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZ3uZBAAKCRDBN2bmhouD 170CD/4vWTXyM+nvORyBOO1HAK3W0ud+c+2A8tl59Lb1I4sWHkW4LsivhtrE1Rwl5GdaJ4TjOE/ H1S9aW6Knaj85ZbFgSn8yKFtH4gPfhlh25E+ruqAzVgR8WS+kcEjJDm6stWoH2vver59o4/PHB2 ZyZ46MvdktfvPOVelOt11uQbshRiXDbsAFNoYKa6vIfoN5u7JYQP4yeq47XH8SpZ2Y+QtrC+Ah+ 6plefQsrq4PUjEd70qUdUNs/5dDRNj+WEAsYwa7XwfizNY9BgmzaqA0nPRJJu291mMn0q+w2cCV 3njkqnQnLoZEyRvH2qndWKqv0Lk8Oa2aWrrZjhpP2nXUIaSfWaoYtnRvQLXBqoMmCrdClhVYm42 OfxsGBUUZCHIJbudkTKO6McO69ugiHBMC7ELfNmZs1as1cyAAoM1yemtUhTdwumN3OXyL12so6a 5FqymO8OhgJ5EJP+/BCcHMwMh8XFggQeYVAnf0xv0JqLB6KPIxwHTxJ5PAWImeZrcWH7svCjMwB 8EXxbxK7fA95BKBNWO2vbgBwTdsFSobfFhDPyaX3AvfcGRNgeJnjEexIqNgyHdQWTZAOdPdq9LU FY/x0NonnDbO7lPSw39p/C4Kl93CNn+QGF2Vjy7GyshrYPZtwshEd9IWB69OIUDZwvmS4VWk939 JMpdFnWtunCaGSA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" dsi_clk_init(), which gets the clocks, is called only through platform driver probe and its failure is a failure of the probe. Therefore NULL-ifying specific clocks is pointless and redundant - the PTR_ERR value stored there won't be used/dereferenced afterwards. What's more, variant-specific clock init calls like dsi_clk_init_6g_v2() are not doing this cleanup. Dropping redundant code allows later to make this a bit simpler. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi_host.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index a98d24b7cb00b41d3bb371a965a80ceaa93775a6..86ac145076416fa7651d18820266a00d28e44b6f 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -292,7 +292,6 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host) ret = PTR_ERR(msm_host->byte_clk); pr_err("%s: can't find dsi_byte clock. ret=%d\n", __func__, ret); - msm_host->byte_clk = NULL; goto exit; } @@ -301,7 +300,6 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host) ret = PTR_ERR(msm_host->pixel_clk); pr_err("%s: can't find dsi_pixel clock. ret=%d\n", __func__, ret); - msm_host->pixel_clk = NULL; goto exit; } @@ -310,7 +308,6 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host) ret = PTR_ERR(msm_host->esc_clk); pr_err("%s: can't find dsi_esc clock. ret=%d\n", __func__, ret); - msm_host->esc_clk = NULL; goto exit; } From patchwork Mon Jan 6 08:49:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13927220 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3CDF4E77198 for ; Mon, 6 Jan 2025 11:53:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A665610E642; Mon, 6 Jan 2025 11:53:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="LQb1DFPN"; dkim-atps=neutral Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 617CD10E642 for ; Mon, 6 Jan 2025 11:53:24 +0000 (UTC) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-436203f1203so21255625e9.2 for ; Mon, 06 Jan 2025 03:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736164343; x=1736769143; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=4TdAMmMa/36NEGjSEYdL3bgt28g6gvQSvEW+I+wH1Zw=; b=LQb1DFPNZabkScLh0rEq7nHN1HZZ3pWAtEiZfJDjGVWDmdL3ysAboUoGNVVXyTwYvR hnFQNaVR+bW9M4x6nCc0ycfAG6355HCIkdu9jCjm0FZb0nedB4zZY665v9s4HAkegewN 2O+OG2NC2ziaHRUvD37kDa0ZEe0zhZ4xbXFVMNdKOh28ERSACD878M2lMdVWdbmxR1Kv 9Y4ZxxEfRrEIgjQB7miHkJ0+hUjVi0VF07fDlu4NkmT5KNXtHtmqPt6cfd66M1BHzmE9 rmrhZW9IZ0F3sJWYussyajzvw3iNNiDzwV+RnmuuOGGxbCIOwq4s597U9pTelMNfn+xn BlHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736164343; x=1736769143; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4TdAMmMa/36NEGjSEYdL3bgt28g6gvQSvEW+I+wH1Zw=; b=XlNVzRtjIym8vy5zSfkr8KY2hs21j+k2GbwzM4KDCdpzODC73Q8fr/miYcXNw7xyX8 gTxlzbnyTD0h5i4sImqsH+MKqrLz7lY9MjEjHtA2DHoFe9Do+tK4zo59I2Vp+LNlh5c8 NZg72NyBWaxjBvh1fcCCnCRFocrhT82F3kpuvJzOgkWJp5gNH6xGaWoMiNwNrNUhc4aK klnlHg4ci+BSMsxilWUKi6NQTkItJ5wRtYwYN4ndAsmEBufWAHe7rJe6cwNeOCVkMTRM jx56YnKCSYaGEep/ArZ2njXnL6Xu2hBV7MmXGpVHV0EPYh2pGaHTX0L2AtyZxXJzB3Kc 3kcg== X-Forwarded-Encrypted: i=1; AJvYcCXolcf7AT9GwLBjzEuKf5srSksAC+2BF/yTsY706glUIveWynb/alJFm7M5K+iAdMQC/9z8xta8ds8=@lists.freedesktop.org X-Gm-Message-State: AOJu0YyQnER1FZZZIejSsshGx440Clhp+9aKMw8wme7ryEiylGv1kqaJ j7sO9Utr7Ce0JXk3y6VZ6/sAoY/g/ug+fBi+3Ch0F6Zs4jIcqQNNXwRZRsgWQS5RIIRTny80F0Y R X-Gm-Gg: ASbGnctQqKNu2H1NdsB2F1C2aNb9aAzewhK5e+9WdHMr0HtKiCNWfR2GHQrL9rjOoog J06oFc5osaPe68kbCXYK7espmMEFPjwwldtz4cuFA5SO6IHBzajppMeeV0MVoyQoODP2WxnmDuo 6yF1j7indlJ+2kpyVCvNoAT46rw27oKmKGPuvnauBhPFu0g2+9xOrYxOC+pZrKFWCFkf4niLkkr 9ckTrlWGT3M/HON1pc0Q5ocLpPfN7Cvh8wRk903gy0OSR5+CVvseefo+4smOu84GQop6vUj X-Google-Smtp-Source: AGHT+IGuPEKa7Y8wn+0uOc+1jJboUlCaDTd8y6XllLGlDHCj5Ga52ftDkrVG81dndBjt+D74ERoj/g== X-Received: by 2002:a17:907:7e92:b0:aa6:a674:be3c with SMTP id a640c23a62f3a-aac2adb56d7mr2031661366b.5.1736153356335; Mon, 06 Jan 2025 00:49:16 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e82f1d2sm2222112466b.11.2025.01.06.00.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 00:49:15 -0800 (PST) From: Krzysztof Kozlowski Date: Mon, 06 Jan 2025 09:49:05 +0100 Subject: [PATCH 2/4] drm/msm/dsi: Simplify with dev_err_probe() MIME-Version: 1.0 Message-Id: <20250106-drm-msm-cleanups-v1-2-271ff1c00795@linaro.org> References: <20250106-drm-msm-cleanups-v1-0-271ff1c00795@linaro.org> In-Reply-To: <20250106-drm-msm-cleanups-v1-0-271ff1c00795@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6526; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=lYvt5NktykrU4G4k710RiF9T2No7atg8/NYgEiARUDI=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBne5kFeF66qxefqCkeKAcrKm6G/RWzKa1Lo5O6x 9gKuZfWWj+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZ3uZBQAKCRDBN2bmhouD 13A/EACCArEJHarifsC36OvyaQw2iWP5JpsdZKyCO79MFzugRGcxQEyzTiD76HWcoC2bprBXWcV mC0MtsPseAqH8bFRdpYIBGM7Y4Gf47s2G7MRykpCTKhr9LcSYj2IxGGsnGCziJG5v7T5iemwMAj uYvAFEnrvcS4mkVUxOzB6aJpEL+DbC3XXtRtx7rdH0/15gEPtcq11hJaxmzSeZ5QJPXnQEqc+Xb NBKKOsaO+nafD0HpK3UhrlpuSP8T6TNcuz3k1VO4RxYHAmUmcwYhChjpt/3IstlyS8RG79pNfXV jRYO9X2LnBPaa4QgNLk2FwUsKZyieP5oKqpc043UtKAyUrnqEP7JI3dvhnjt9AlgKKaDM410eO/ wEAzzv67SOIy1MwMh5N68UjcjM6ukxTOnhHw/SUuGPs9LT958aaavKh6vWif7xZWbzWl154Td72 qbm6cvOdJnltxlMSbzrw/R3OjcgUuwiSO92rmaFCXSPUUHgLmHyHxrpFwdHbCD/TYtki7Kuh00L EOAa5y4hs1Sth9fQ59nLsuEz4VEEG/HutyLPpsBNDuoxCdqFQs5R1ek7df1WcGBynYvKkOMpFJs QkIo8A83bTFKTMrh2plnrqA4ecPm+yTmDArVLXlrz1bvCXWrslhUr+1g52EsmMbbccfH/OO6Yj8 W5cpQ0NNLsNjBUQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" dsi_clk_init() and msm_dsi_host_init() are called only from platform driver probe function, so using dev_err_probe is both appropriate and beneficial: - Properly marks device deferred probe status, - Avoids dmesg flood on probe deferrals, - Already incorporates printing ERR value, - Shows device name (in contrast to pr_err()), - Makes code smaller and simpler. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi_host.c | 100 +++++++++++++++---------------------- 1 file changed, 41 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 86ac145076416fa7651d18820266a00d28e44b6f..4a2ad04eea7359545a088bdc63907f6b3e5615bd 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -200,7 +200,8 @@ static const struct msm_dsi_cfg_handler *dsi_get_config( ahb_clk = msm_clk_get(msm_host->pdev, "iface"); if (IS_ERR(ahb_clk)) { - pr_err("%s: cannot get interface clock\n", __func__); + dev_err_probe(dev, PTR_ERR(ahb_clk), "%s: cannot get interface clock\n", + __func__); goto exit; } @@ -208,13 +209,13 @@ static const struct msm_dsi_cfg_handler *dsi_get_config( ret = clk_prepare_enable(ahb_clk); if (ret) { - pr_err("%s: unable to enable ahb_clk\n", __func__); + dev_err_probe(dev, ret, "%s: unable to enable ahb_clk\n", __func__); goto runtime_put; } ret = dsi_get_version(msm_host->ctrl_base, &major, &minor); if (ret) { - pr_err("%s: Invalid version\n", __func__); + dev_err_probe(dev, ret, "%s: Invalid version\n", __func__); goto disable_clks; } @@ -281,39 +282,31 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host) msm_host->num_bus_clks = cfg->num_bus_clks; ret = devm_clk_bulk_get(&pdev->dev, msm_host->num_bus_clks, msm_host->bus_clks); - if (ret < 0) { - dev_err(&pdev->dev, "Unable to get clocks, ret = %d\n", ret); - goto exit; - } + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, "Unable to get clocks\n"); /* get link and source clocks */ msm_host->byte_clk = msm_clk_get(pdev, "byte"); - if (IS_ERR(msm_host->byte_clk)) { - ret = PTR_ERR(msm_host->byte_clk); - pr_err("%s: can't find dsi_byte clock. ret=%d\n", - __func__, ret); - goto exit; - } + if (IS_ERR(msm_host->byte_clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(msm_host->byte_clk), + "%s: can't find dsi_byte clock\n", + __func__); msm_host->pixel_clk = msm_clk_get(pdev, "pixel"); - if (IS_ERR(msm_host->pixel_clk)) { - ret = PTR_ERR(msm_host->pixel_clk); - pr_err("%s: can't find dsi_pixel clock. ret=%d\n", - __func__, ret); - goto exit; - } + if (IS_ERR(msm_host->pixel_clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(msm_host->pixel_clk), + "%s: can't find dsi_pixel clock\n", + __func__); msm_host->esc_clk = msm_clk_get(pdev, "core"); - if (IS_ERR(msm_host->esc_clk)) { - ret = PTR_ERR(msm_host->esc_clk); - pr_err("%s: can't find dsi_esc clock. ret=%d\n", - __func__, ret); - goto exit; - } + if (IS_ERR(msm_host->esc_clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(msm_host->esc_clk), + "%s: can't find dsi_esc clock\n", + __func__); if (cfg_hnd->ops->clk_init_ver) ret = cfg_hnd->ops->clk_init_ver(msm_host); -exit: + return ret; } @@ -1879,31 +1872,28 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) msm_dsi->host = &msm_host->base; ret = dsi_host_parse_dt(msm_host); - if (ret) { - pr_err("%s: failed to parse dt\n", __func__); - return ret; - } + if (ret) + return dev_err_probe(&pdev->dev, ret, "%s: failed to parse dt\n", + __func__); msm_host->ctrl_base = msm_ioremap_size(pdev, "dsi_ctrl", &msm_host->ctrl_size); - if (IS_ERR(msm_host->ctrl_base)) { - pr_err("%s: unable to map Dsi ctrl base\n", __func__); - return PTR_ERR(msm_host->ctrl_base); - } + if (IS_ERR(msm_host->ctrl_base)) + return dev_err_probe(&pdev->dev, PTR_ERR(msm_host->ctrl_base), + "%s: unable to map Dsi ctrl base\n", __func__); pm_runtime_enable(&pdev->dev); msm_host->cfg_hnd = dsi_get_config(msm_host); - if (!msm_host->cfg_hnd) { - pr_err("%s: get config failed\n", __func__); - return -EINVAL; - } + if (!msm_host->cfg_hnd) + return dev_err_probe(&pdev->dev, -EINVAL, + "%s: get config failed\n", __func__); cfg = msm_host->cfg_hnd->cfg; msm_host->id = dsi_host_get_id(msm_host); - if (msm_host->id < 0) { - pr_err("%s: unable to identify DSI host index\n", __func__); - return msm_host->id; - } + if (msm_host->id < 0) + return dev_err_probe(&pdev->dev, msm_host->id, + "%s: unable to identify DSI host index\n", + __func__); /* fixup base address by io offset */ msm_host->ctrl_base += cfg->io_offset; @@ -1915,10 +1905,8 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) return ret; ret = dsi_clk_init(msm_host); - if (ret) { - pr_err("%s: unable to initialize dsi clks\n", __func__); - return ret; - } + if (ret) + return dev_err_probe(&pdev->dev, ret, "%s: unable to initialize dsi clks\n", __func__); msm_host->rx_buf = devm_kzalloc(&pdev->dev, SZ_4K, GFP_KERNEL); if (!msm_host->rx_buf) { @@ -1931,26 +1919,20 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) return ret; /* OPP table is optional */ ret = devm_pm_opp_of_add_table(&pdev->dev); - if (ret && ret != -ENODEV) { - dev_err(&pdev->dev, "invalid OPP table in device tree\n"); - return ret; - } + if (ret && ret != -ENODEV) + return dev_err_probe(&pdev->dev, ret, "invalid OPP table in device tree\n"); msm_host->irq = irq_of_parse_and_map(pdev->dev.of_node, 0); - if (!msm_host->irq) { - dev_err(&pdev->dev, "failed to get irq\n"); - return -EINVAL; - } + if (!msm_host->irq) + return dev_err_probe(&pdev->dev, -EINVAL, "failed to get irq\n"); /* do not autoenable, will be enabled later */ ret = devm_request_irq(&pdev->dev, msm_host->irq, dsi_host_irq, IRQF_TRIGGER_HIGH | IRQF_NO_AUTOEN, "dsi_isr", msm_host); - if (ret < 0) { - dev_err(&pdev->dev, "failed to request IRQ%u: %d\n", - msm_host->irq, ret); - return ret; - } + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, "failed to request IRQ%u\n", + msm_host->irq); init_completion(&msm_host->dma_comp); init_completion(&msm_host->video_comp); From patchwork Mon Jan 6 08:49:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13927082 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94856E77199 for ; Mon, 6 Jan 2025 08:50:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 50A4610E5CD; Mon, 6 Jan 2025 08:50:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="mCMOh4js"; dkim-atps=neutral Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3EBEF10E5CD for ; Mon, 6 Jan 2025 08:50:19 +0000 (UTC) Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-aa6a38e64e4so236426066b.0 for ; Mon, 06 Jan 2025 00:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736153358; x=1736758158; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FqYqpE74NSCIuQ6we8Kew8vkG28Edsdn09mE/ypD+oI=; b=mCMOh4js717+pj2S9+20ZF+xDaH97nbZ4LJu/rEL+dUWVe5t9e+E6DM5lbXEz2tG/6 eNXr/xKmrJYMq45kwwPVq5XNPgJO7Aco3W4yA9N5Uy//DNx7AJ/jsd2UyMLd2s43F7e1 BWVmptVymGXh28udODqJpUDbL8wk1aWP5Vxk1pwKwiIzrrJgqPhhbPsdsiH7OI5fOPGR +yme3ny9bVN+Avf6aipTIx149mwGagAECVuDqnnoBePZmWXSvAcizcWLrlP/G9vsALth huZz8TNky2GCroY8CALXw+XgQ+JMTDLlE5c8FORQ1QdK4Vf9dRTs9z8euK0f9kNH5iXw Au0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736153358; x=1736758158; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FqYqpE74NSCIuQ6we8Kew8vkG28Edsdn09mE/ypD+oI=; b=UQZyJ2U8wLM+IJvZzJkwXxeFbztAA8eM0InrYiiyU0DuXZr5kccxs19+Mo2jpXkv7i Ckwj8C36xiBnxDETAivHkr6adeD5OoeYUou8SgXlzbIrgKTojpl4XeSLxRAS+e2eG0xi wHPuMwv/l+UKE0EyxWqyKvgT7jFWsw59qXd/bTaiB2jR3CyUE4hnZBgk5h1721UyDGpS VazrfiZ+RhaB+/O+xDwpVNWabbiZPiVWD60lq5C4CXOiDV1LZCFNG+dbrcdp3TnGx7Ma xbX9cIB/Fpm37hOvU003uBLtCscjbmWQ6JfAl8VLnl5irYrmo+gEL+J/ASZpg5lVAjyZ zT3g== X-Forwarded-Encrypted: i=1; AJvYcCXEBGFvAHpLWC9fxcQyloNlP5EhHvWqLMc9elJNuo3EG5hv7tPK05j/iwTq0koZBvb2IJg9KgzBzkw=@lists.freedesktop.org X-Gm-Message-State: AOJu0YxkrFS/oltyISabGPVFQq3yJnsy+FFFFspHvUMEuoPMhUOIztRf MoTWy9YUIkn10OeIvHOgSQzOxnha9Epa8RWT2U0AiaIBiDG6Tum/9Kb9LUwNBMU= X-Gm-Gg: ASbGnctEDiQmwZB9vZR9Q7yjKDBvR3vIAHYLrt8/pOrcLvG6k0QmT5RQtV4DmeGHY/c pNX0OR9iwNm/FjsyStZ3qRFc64XxClNfXrOVSbEnUjm7xejhkJjBvLfLD45DGQAKtkDpgmhxr/w GkAZBqxTjVnWQg7IEn1EDEOe3d89lcAzBfUKnd2DkQ/WD5N8jOb2LF+mAp1qcp/dupOBND4fIOT tRTFQmJasBW2NTQviAtJNfbaShrwt4KeH9WaquvqowPMTe97ljpBYQsaM2jJhFL1yHoH2SK X-Google-Smtp-Source: AGHT+IH+pwK330xaahhvQucFSZxUuXVT0b0dCvqw2hihR/wXtnoUMiZ/CIdtEfAi9ckdZ9cr0u7txw== X-Received: by 2002:a17:907:3d86:b0:aa5:3e81:5abc with SMTP id a640c23a62f3a-aac2714ad32mr2069989566b.1.1736153357678; Mon, 06 Jan 2025 00:49:17 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e82f1d2sm2222112466b.11.2025.01.06.00.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 00:49:17 -0800 (PST) From: Krzysztof Kozlowski Date: Mon, 06 Jan 2025 09:49:06 +0100 Subject: [PATCH 3/4] drm/msm/dsi: Minor whitespace and style cleanup MIME-Version: 1.0 Message-Id: <20250106-drm-msm-cleanups-v1-3-271ff1c00795@linaro.org> References: <20250106-drm-msm-cleanups-v1-0-271ff1c00795@linaro.org> In-Reply-To: <20250106-drm-msm-cleanups-v1-0-271ff1c00795@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4972; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=/a3blq7uTO7fUJvEaGIXSRTJ4dpfb7qJYZHpImk2dVY=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBne5kGPLcMDXTAFLB7FrGzq2KBwobfDoM2Axvrj aejM+xFPaCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZ3uZBgAKCRDBN2bmhouD 12suD/9plZkSR1GSSGcpRhCfw5+T70v5pcFayEvEVJBIDykDJm8lIN92LDQE5NBumEO11lwWxPC CZ4f/waCUhmh3Loap2GjCt4/4TxZBM1+aMK0//cTiLj7LoTR0mYfUSIjZ11gIsOPOaQwsh1CeXC yUvvzhwKVTJCm+oHioyAbm3GexCFBEn7GRx6yLHqtto5VOgMlaFh0GsUry3e6LIpIkevjZmCpGz cS+TaFatdkNFN77I2PGoi1aw3iIR82bKz7Aeu+K09XcJuNuCDZbTcgZlyRae6i4lveD+Pl7U5ir jiulukBPI60UsavcKrcTuTLAk4HCe5/t7gkYg1vhOV5ZoCe1xpxZEr15oMtZki6S9y9bSpjycyG ha3tev3HEVuUFIQhikzEOfOHkrCu0k9LgY+UZ77Lv5alOKdF6SIVlWICmhlhe5oOZTLKZPJKYlJ byShuxZrJF71LQzuuRgkWc4rr2CCgNVIdhSDA45ohfZCR98soas9LngZ/suxJdM19rW8C4tzeR7 pdkdcCPWQH3djhjBFye1+bjsiynZ/HPhGOijgIGeDZxLiFnTM0m0lmZmlWsbRANHQ//cOXMvMhu i3mvlotSNMgX/cEKm8c19rqHws8FkfadXTX6VfvoaxLTQMTwRGHBmpF/j3HxbxwdRoWxLoXOvfO bpSXOzVQ17OSjcA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Cleanup few obvious kernel coding style violations: missing or unnecessary braces in 'if-else', unnecessary break lines, incorrect breaking of long function declarations, unnecessary 'else' after a 'return'. No functional impact expected. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi_host.c | 51 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 4a2ad04eea7359545a088bdc63907f6b3e5615bd..a3c344b75fc2e90923cd6d26df87b7c05208f736 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -179,18 +179,18 @@ struct msm_dsi_host { int irq; }; - static inline u32 dsi_read(struct msm_dsi_host *msm_host, u32 reg) { return readl(msm_host->ctrl_base + reg); } + static inline void dsi_write(struct msm_dsi_host *msm_host, u32 reg, u32 data) { writel(data, msm_host->ctrl_base + reg); } -static const struct msm_dsi_cfg_handler *dsi_get_config( - struct msm_dsi_host *msm_host) +static const struct msm_dsi_cfg_handler * +dsi_get_config(struct msm_dsi_host *msm_host) { const struct msm_dsi_cfg_handler *cfg_hnd = NULL; struct device *dev = &msm_host->pdev->dev; @@ -370,7 +370,6 @@ int dsi_link_clk_set_rate_6g(struct msm_dsi_host *msm_host) return 0; } - int dsi_link_clk_enable_6g(struct msm_dsi_host *msm_host) { int ret; @@ -588,7 +587,6 @@ static void dsi_calc_pclk(struct msm_dsi_host *msm_host, bool is_bonded_dsi) DBG("pclk=%lu, bclk=%lu", msm_host->pixel_clk_rate, msm_host->byte_clk_rate); - } int dsi_calc_clk_rate_6g(struct msm_dsi_host *msm_host, bool is_bonded_dsi) @@ -677,8 +675,8 @@ static inline enum dsi_traffic_mode dsi_get_traffic_mode(const u32 mode_flags) return NON_BURST_SYNCH_EVENT; } -static inline enum dsi_vid_dst_format dsi_get_vid_fmt( - const enum mipi_dsi_pixel_format mipi_fmt) +static inline enum dsi_vid_dst_format +dsi_get_vid_fmt(const enum mipi_dsi_pixel_format mipi_fmt) { switch (mipi_fmt) { case MIPI_DSI_FMT_RGB888: return VID_DST_FORMAT_RGB888; @@ -689,8 +687,8 @@ static inline enum dsi_vid_dst_format dsi_get_vid_fmt( } } -static inline enum dsi_cmd_dst_format dsi_get_cmd_fmt( - const enum mipi_dsi_pixel_format mipi_fmt) +static inline enum dsi_cmd_dst_format +dsi_get_cmd_fmt(const enum mipi_dsi_pixel_format mipi_fmt) { switch (mipi_fmt) { case MIPI_DSI_FMT_RGB888: return CMD_DST_FORMAT_RGB888; @@ -1282,14 +1280,15 @@ static int dsi_cmd_dma_add(struct msm_dsi_host *msm_host, static int dsi_short_read1_resp(u8 *buf, const struct mipi_dsi_msg *msg) { u8 *data = msg->rx_buf; + if (data && (msg->rx_len >= 1)) { *data = buf[1]; /* strip out dcs type */ return 1; - } else { - pr_err("%s: read data does not match with rx_buf len %zu\n", - __func__, msg->rx_len); - return -EINVAL; } + + pr_err("%s: read data does not match with rx_buf len %zu\n", + __func__, msg->rx_len); + return -EINVAL; } /* @@ -1298,15 +1297,16 @@ static int dsi_short_read1_resp(u8 *buf, const struct mipi_dsi_msg *msg) static int dsi_short_read2_resp(u8 *buf, const struct mipi_dsi_msg *msg) { u8 *data = msg->rx_buf; + if (data && (msg->rx_len >= 2)) { data[0] = buf[1]; /* strip out dcs type */ data[1] = buf[2]; return 2; - } else { - pr_err("%s: read data does not match with rx_buf len %zu\n", - __func__, msg->rx_len); - return -EINVAL; } + + pr_err("%s: read data does not match with rx_buf len %zu\n", + __func__, msg->rx_len); + return -EINVAL; } static int dsi_long_read_resp(u8 *buf, const struct mipi_dsi_msg *msg) @@ -1366,8 +1366,9 @@ static int dsi_cmd_dma_tx(struct msm_dsi_host *msm_host, int len) ret = -ETIMEDOUT; else ret = len; - } else + } else { ret = len; + } return ret; } @@ -1435,11 +1436,12 @@ static int dsi_cmds2buf_tx(struct msm_dsi_host *msm_host, return len; } - /* for video mode, do not send cmds more than - * one pixel line, since it only transmit it - * during BLLP. - */ - /* TODO: if the command is sent in LP mode, the bit rate is only + /* + * for video mode, do not send cmds more than + * one pixel line, since it only transmit it + * during BLLP. + * + * TODO: if the command is sent in LP mode, the bit rate is only * half of esc clk rate. In this case, if the video is already * actively streaming, we need to check more carefully if the * command can be fit into one BLLP. @@ -1864,9 +1866,8 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) int ret; msm_host = devm_kzalloc(&pdev->dev, sizeof(*msm_host), GFP_KERNEL); - if (!msm_host) { + if (!msm_host) return -ENOMEM; - } msm_host->pdev = pdev; msm_dsi->host = &msm_host->base; From patchwork Mon Jan 6 08:49:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13927083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19207E77198 for ; Mon, 6 Jan 2025 08:50:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0DCA10E5D6; Mon, 6 Jan 2025 08:50:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="J9bp3k4U"; dkim-atps=neutral Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id BEE9A10E5CE for ; Mon, 6 Jan 2025 08:50:20 +0000 (UTC) Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-aa67bc91f88so147485866b.0 for ; Mon, 06 Jan 2025 00:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736153359; x=1736758159; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1OTbFFc/LXvyixbtCvH1lSFOmelihjhQMXdOHvfDhy0=; b=J9bp3k4UlfbVF71AkOaYenZe6Bu7SnaPJXTHDmplq0BnOTbHGGIY6l75j/qHFw1E08 MQzOQ4rjr9tjAhNtZFADtCmbvl1iFgfZK5H31OHW3MAWmECtGVrTd3yoddlhyXnxCyqD +vh6EDJ3f4PcMUJTeeMB+WE0Ikj86SlUPWVErXS2Covg+wwt83b5QTKhcljITg99CW9S 2EEDDzitokjfaNPUI5J5plHINp6l9+re+DQlHCaUGpVTbUS0s1MAO4xd4jqdAsQuA8PL kAUIcIYuIONHFe+8q/WNtXGth0hoLa8XfSfape6IpieAdiU4xbVR5fWG37Vq3zeGyudw 3SBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736153359; x=1736758159; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1OTbFFc/LXvyixbtCvH1lSFOmelihjhQMXdOHvfDhy0=; b=U8aBUMZjRhIeUAzINV8+fyT4JFwsf0hkpBbdd2smH1H1Vx8r4cTN0ETDKHHy01hGeW nZe2GIIdcGtD08fJCxaY5zaRt4jROWocoC9K8rKzwF7/g9XKZoA1KpojPUqrVjz/Zff7 p8Fgvejkn8mz0TR0Bt71qthv9Us/H3XQF7nacjXw/c5qckm7GATW4tIN3Yqgfpw351by dzbA2M149z3lB8c5s3WwWt6icp8Z+Eyi7ZepzxlegpR8KfiO1HbqL7MKv3Qk8HVt2qvH 9ncvkGTh9OVNfZ5USEqxfEbJWTLLg/7x2kIFEBGmNQJ147vC+CEjNxIHAwRZNYGoboaK mOyg== X-Forwarded-Encrypted: i=1; AJvYcCU2tgbXowLNqlCu1wxiz9KV0RzKP/nzW2ZBvzwvVcOftDySbGclMQSXR/MlygEw8qIGNaUevnqpQ40=@lists.freedesktop.org X-Gm-Message-State: AOJu0YyuVENtQ0fNhrl6y798smaLPVKPFFGamwBA67ZsJWzjRiY+1hYQ ZpCVr6r3LjEau1FGUg8mu7lSjUFgQdzVeXIYEvZ3c2XGGZdN+W79XsnhpFqWRwo= X-Gm-Gg: ASbGnctP7LyMQ2vexT+L8jr62jlLcjyhZz9RjWS6PVuMc3o7Htb+BgwlQscjL34+rnI RqCrPdf5NR/2Vc4Gw0AzYxn0C2Zck3AIGnuF/FHo0EQlCno7B7rIdzjZD4iLU+pbR8AfF6jTQux 6JyLfw+vwWf23yNO7yIxayWn6Daj7OtB2MUpOF2XBydjIeneTtuj0YrSZvuYHDzsTCfZBTgJiDj FwLxjtYZ7lzWNi+5zL9g97LCr0mgLosTisaZCBX1OtPgpgHWtALYa3vLM1HkRDuPfuCaKr7 X-Google-Smtp-Source: AGHT+IFIUVGQua1Xw3vRS6huyRc0JaTlrVfc5UE7MBVZ/n19b0POGxtnLkoCKWi3gDrpntvSQ/EKdw== X-Received: by 2002:a17:907:d15:b0:a9a:2a56:b54 with SMTP id a640c23a62f3a-aac2b0a5754mr2065982266b.5.1736153359387; Mon, 06 Jan 2025 00:49:19 -0800 (PST) Received: from [127.0.1.1] ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e82f1d2sm2222112466b.11.2025.01.06.00.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 00:49:18 -0800 (PST) From: Krzysztof Kozlowski Date: Mon, 06 Jan 2025 09:49:07 +0100 Subject: [PATCH 4/4] drm/msm/dsi: Drop unnecessary -ENOMEM message MIME-Version: 1.0 Message-Id: <20250106-drm-msm-cleanups-v1-4-271ff1c00795@linaro.org> References: <20250106-drm-msm-cleanups-v1-0-271ff1c00795@linaro.org> In-Reply-To: <20250106-drm-msm-cleanups-v1-0-271ff1c00795@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1024; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=nandoTBlk2Y45lzh0OGLLD7YfL+lOntjDjuGTghJ18A=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBne5kHtIEraO4MOoEqSxz6JNQXpGpHLSrNWQfEX iZDY+GUnhCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZ3uZBwAKCRDBN2bmhouD 1+pED/0THA/VJeshxpTNG9Q9JUM5ne/rmPhAfuMC36rcRts0nb3XRM2iJl8ZrqdhFYwziOdXoS3 GRJTa3s1Eeeqfx1JNNOnuMW9YsZfTCUgkhFzjIhFKjMbkcAEZ0Y6zCyzL7Ey7ew/f6aWWrBxRS4 pPbOMMtTaJNNfNyBhKOXy+hsriEseN/h6V+T4YCHsyxNnzy0HoIo3rKXnVLXzxSBFdxnG0uyDe5 yXGCG0QKaz11TvN1/7TQlHPBoBdSxcJQizikrKJroAvaxgBYELQ3x4nGwfUPMx/twJHbFMKOvE4 kMuxbk/t7dG/vWsm018wcK55Ae4+qlTx2IpL4zeP8YH/rdw2PBcaW2B0XsURYguU/i2EP+KdKc+ pcUT/cN2UgCuRcGQsK3E5h+X2SitLjIZ0MRsJ3my29iq+WqiPc6DHUsMcaoO+PAqHwS4FXGWeKg 3v+8gyd7mq6FTii7t73DOWxncRQxn6IzEcNoTs96DIw6iRwMcC5VpS+Ot8nTlUDQOLGrqaaHED2 K5BchCderk1lOcNzZnjMDIedb30NjdC54RfgLsO7vHRypJfOx0RgPvtBrGkR63epFmoYTCYPkID mN6AlEF28DCjSSJbuWWOxwRS+V88wvWAcqx2k72/pPjLLIRyiDYSMYSd0pShYQ8/4TcgQwS11D0 mNDGUnoEj02fbUQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Kernel core already prints detailed report about memory allocation failures, so drivers should not have their own error messages. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi_host.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index a3c344b75fc2e90923cd6d26df87b7c05208f736..ab5d6fd53972f62307b0c5b801cca8b2394c5556 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1910,10 +1910,8 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) return dev_err_probe(&pdev->dev, ret, "%s: unable to initialize dsi clks\n", __func__); msm_host->rx_buf = devm_kzalloc(&pdev->dev, SZ_4K, GFP_KERNEL); - if (!msm_host->rx_buf) { - pr_err("%s: alloc rx temp buf failed\n", __func__); + if (!msm_host->rx_buf) return -ENOMEM; - } ret = devm_pm_opp_set_clkname(&pdev->dev, "byte"); if (ret)