Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp268014ybj; Mon, 4 May 2020 21:03:24 -0700 (PDT) X-Google-Smtp-Source: APiQypKLZ31Zb2UrSi4NJEPUzo6t183lIFtW27mm1QMuHBk08mPHyG9TFUhm35oXii8Mv74SvGCD X-Received: by 2002:a17:906:2410:: with SMTP id z16mr938374eja.1.1588651404631; Mon, 04 May 2020 21:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588651404; cv=none; d=google.com; s=arc-20160816; b=QPAP38079FVD2sP/HHdHZh82ECQyrlkB+bU7d37z7xyMZg2IjxXc5CikCgABtWJqAz +xKqOji+PPQTFQGADeY7qY60eC2VoLPPVptyXRGxFXNBtpUkvT5t2v0eoBbNhDwV7q6Y eYR8diUicRJnxpk/XXQ2q1kXd1oZVaVNKOOFk/ch9H/uJyCvjeZR32X2xxbLeYTVWUdG hFhwaDThk6faFbv84Tpal9DlWVBLk110AumB2j5PrjI4sn0SeWbINGRnWQIGBufP1qVv MQXPrG8iop45bi86VLsYwrNCJBzmYtMrK5BhNGojM2Rb6CM1BfNgbGbweUgmBAZSBioA TNhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ctoh4fSKKdbnfncF1YOVBJD74K9A/+MRfOMQ6EjpdWU=; b=XCOgKNqiu/fgNaRee+tmotmdqicy5fv8FL2pHh8mm7xErPoT3D5Xn/dlH3TW27VZS8 HRxVUD02eZdsEpaxv+agydVHl7ANjp+FmK/TayiKeV9NI8CZulNDS536hzWhLPgsmjNs ov4+YJgEPuMtz23+MKD0r/Fo0PcSK4CGCGpRkvumMm+u5M6VK000IQsAyJD8ZDQQ0U00 TUaPbgVSd8HZ9YnJfZicsNlqe8bHWMPdQUEUg4lxY85NVnyZaDYkYUuB73Lj/bpnqSHA w5sTO8yR3DVvdqgYbR9vzZOId55SI9xu6hsQyKdj3ai0HXY0okPHAyfOTMHLZ5v6iG1m lgnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ii8+KtIL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pj27si404502ejb.196.2020.05.04.21.03.02; Mon, 04 May 2020 21:03:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ii8+KtIL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726550AbgEEEBZ (ORCPT + 99 others); Tue, 5 May 2020 00:01:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726529AbgEEEBY (ORCPT ); Tue, 5 May 2020 00:01:24 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57B71C061A10 for ; Mon, 4 May 2020 21:01:24 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id h12so669760pjz.1 for ; Mon, 04 May 2020 21:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ctoh4fSKKdbnfncF1YOVBJD74K9A/+MRfOMQ6EjpdWU=; b=Ii8+KtILgS8kUQw30kWi/g6X8rQQSL7btnKUADBZbiGPsB7xgLrjW/n8WdNDKbgQWN tD0CyhvsndPuo5olMQnHe7XkJqOToYWcqesKzfNx4Cr9zVrfqs44PzQD1F0/aSptMOBL eUsczSXbwqFmnb3O1kmfFjGdB5/HS/Xh7TVSI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ctoh4fSKKdbnfncF1YOVBJD74K9A/+MRfOMQ6EjpdWU=; b=HuGMrxHCCgVpUj5wtfxlFfsCfqK/oZrA69/1rYkPJ8QJF0FVD2Y98s+fNWxX/57tyn PVowM0xImN4chAjLcMI6/lm8VBWIgj1N6V37TP1V+3iipU/2f61UHcjbIZFl9bevj5+i phVFT7xcln4Xzfa1k3A4wsVNB0Q9o9Cb+DumRcS6sve46y9xZzt0RIRHogUdh0SXrmnz rH7opEKAYAcBkr0vwLIXXV5cwf9DuksaN76fsfUK9H/uSas+QSKuZLT2sLeCA+Zzk+6X PWujAwmndco0Wrlc9NdvKVdVlujKoHUa2t0A65yf2OHov2xKdD8crrKxFZl6ysR2WzlX b34A== X-Gm-Message-State: AGi0Pua6LUgciVHFjFipmo02JGpUjb+I7F2GEgGIINAfKyO5WAzNg/s5 pbddhUhI17azesXOp4/3kmdAXtjlIpc= X-Received: by 2002:a17:90a:7f83:: with SMTP id m3mr525112pjl.147.1588651283555; Mon, 04 May 2020 21:01:23 -0700 (PDT) Received: from localhost ([2401:fa00:9:14:a92f:c47d:76a8:b09e]) by smtp.gmail.com with ESMTPSA id w2sm565152pfc.194.2020.05.04.21.01.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 May 2020 21:01:23 -0700 (PDT) From: Eizan Miyamoto X-Google-Original-From: Eizan Miyamoto To: LKML Cc: Eizan Miyamoto , eizan@chromium.org, Andrew-CT Chen , Houlong Wei , Matthias Brugger , Mauro Carvalho Chehab , Minghsiu Tsai , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v1 2/5] [media] mtk-mdp: handle vb2_dma_contig_set_max_seg_size errors during probe Date: Tue, 5 May 2020 14:00:45 +1000 Message-Id: <20200505125042.v1.2.Ie596e59e0a18935f0b7321ff45e5c5f2ce8082b1@changeid> X-Mailer: git-send-email 2.26.2.526.g744177e7f7-goog In-Reply-To: <20200505040048.132493-1-eizan@google.com> References: <20200505040048.132493-1-eizan@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a cleanup to better handle errors during MDP probe. Signed-off-by: eizan@chromium.org Signed-off-by: Eizan Miyamoto --- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index aeaed2cf4458..c20ac7681c6f 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -193,13 +193,19 @@ static int mtk_mdp_probe(struct platform_device *pdev) platform_set_drvdata(pdev, mdp); - vb2_dma_contig_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); + ret = vb2_dma_contig_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); + if (ret) { + dev_err(&pdev->dev, "Failed to set vb2 dma mag seg size\n"); + goto err_set_max_seg_size; + } pm_runtime_enable(dev); dev_dbg(dev, "mdp-%d registered successfully\n", mdp->id); return 0; +err_set_max_seg_size: + err_m2m_register: v4l2_device_unregister(&mdp->v4l2_dev); -- 2.26.2.526.g744177e7f7-goog