From patchwork Mon Jun 10 08:42:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 166293 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp758994ilk; Mon, 10 Jun 2019 01:42:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmT+bjkaJ63vzl/phWct7CUAww9mnvmOi2+lHOa3YwHBtOReGGy/vumhCRKgskJwAnGgsw X-Received: by 2002:a17:90a:8c82:: with SMTP id b2mr19784319pjo.97.1560156175065; Mon, 10 Jun 2019 01:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560156175; cv=none; d=google.com; s=arc-20160816; b=Nsxr0HAgkRLIGQalkodjTi44/aUhPaYAKmT18inJXU9SaMTFIkdYv/m2NHzsT6GhX9 WhzoAmu2U91oj+2YXPrlzscGQdL3Faz1qiyeMdHB4CmfrS6l6L7A+wsqAIqF660QeUtg lDt4rurzj27YmiE3KLhcKP18Je0Qm3uQoJL+oOMXBrH345tUG3Sepc1FPGnPLy045nGt gxou71JMmdLDosddHdihfC0OXEWVwVK3JgYeoeyxbvTjyfD+0nOdiQdHSrSJZw8nQe1H DsTb1pJKph8dCJuzJqSyoSniDzWdDEkROAtWclx85Fw33aSBCkgw0IwDQa+kI2uYL+p2 m8Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=mEH54ZZbXqjz3IZT5KkSbAecLvKUPwRnXivpNaH2j5c=; b=nq/dxm5Ljzu6VcuBhrk9mOytyFViIKGieqtoMtXbk3/ziGczrBfnwX98zLblshK2Fd Rkt3mJDnUYPaF2DBfqtACtuc8lxDBDbsqjDW/PyM65CzDUaUZb4NnCwliRuFAIZbWUc9 X/7lgPnaD3qvjTi7aqfWqYZd3cScqtFI3+J+8hySumJ6ku1WcNgZVWt0xuLLJvsXjdWj zzZDB8r1ntQqmCvnqiHXJmZH/owoSaqNSNaXw7f4i04L6Tr09+NFB52qNH95QDCuILKd q1Bn4215RED0JwsMhOplnXT7N4/FhdVV2d0g/PB6iBb5HC4pFz3W21raWceaE+3cF5Lg Jzcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a2GG33Xg; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6si2515243pfn.84.2019.06.10.01.42.54; Mon, 10 Jun 2019 01:42:55 -0700 (PDT) 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=@linaro.org header.s=google header.b=a2GG33Xg; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388480AbfFJImU (ORCPT + 30 others); Mon, 10 Jun 2019 04:42:20 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:37783 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388111AbfFJImT (ORCPT ); Mon, 10 Jun 2019 04:42:19 -0400 Received: by mail-wm1-f68.google.com with SMTP id 22so7287958wmg.2 for ; Mon, 10 Jun 2019 01:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mEH54ZZbXqjz3IZT5KkSbAecLvKUPwRnXivpNaH2j5c=; b=a2GG33XgJn18Yol+PHCleaS0zfozddU3pDxE1VGccaW5e5KeVgXCQOZG45tjtfIcaC Lxh5LFI6v+7mSVN/0absvabDtYraYaClMC0Tox8yizarBHRZs5MMT7o+bwZAkx+UYwjc gn+dIt02WuGoIQ96ZxrJl58wiP7WJ81xUZFPZPNaBg1wxnoIeEYCAxMT/iFUVXuCYnHx bgfE+tWRBOGSJHQBya+sXoyJclZs/lcZZa354GRxGDtOM/PZh/447J170T9AjMgOaYBB +XsGQbBGjNMw9PD2U4ouSEzKgUYuRFUJi8Zjv+NXPiv+HQ26SXZwRdLnAsvct3gWghyD Ugfw== 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; bh=mEH54ZZbXqjz3IZT5KkSbAecLvKUPwRnXivpNaH2j5c=; b=Pn461xTVu9GqoworeoNfYYRFHRRNL/7HHqKSTzQ/dkgyPO7aPqPssOU+n5VCQQocLu Xqn52x0yFSF5ddGqjjGmMpw2nf/3w9/cjf2Y6DMUeVDrtMhvJcc3VK4MeIlxe7HWaHFz GjvkaSZwnHIwpcfYQt2f8nsQp+fl+GdO9JfcI5kw6aZ46iuftxqDcQFgrTog0QbgR+oL GiZw9edGIo+H1kkh6yxUFN1k9Ocy8FZhFw6KIuKACfuKlAu+a4f9GfmsV9x3hx4Bt43z 5++hOwovieKSsnp5htatJwrtCRq4ONJn+0iDR8YxnHDDHArxR39xaikBSpkpQhDlRmbU lTRA== X-Gm-Message-State: APjAAAVmoQLNi1uDRrNQ+vBlLhOOR21OhZ/twXt2BCVqje91SFy/9lRW iXvSSnkh+a/y/PZ3wCqZ+FWVNA== X-Received: by 2002:a1c:e356:: with SMTP id a83mr13188870wmh.38.1560156137485; Mon, 10 Jun 2019 01:42:17 -0700 (PDT) Received: from localhost.localdomain ([2.31.167.229]) by smtp.gmail.com with ESMTPSA id a125sm9929670wmf.42.2019.06.10.01.42.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 01:42:17 -0700 (PDT) From: Lee Jones To: alokc@codeaurora.org, andy.gross@linaro.org, david.brown@linaro.org, wsa+renesas@sang-engineering.com, bjorn.andersson@linaro.org, linus.walleij@linaro.org, balbi@kernel.org, gregkh@linuxfoundation.org, ard.biesheuvel@linaro.org, jlhugo@gmail.com, linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones Subject: [PATCH v3 2/8] i2c: i2c-qcom-geni: Signify successful driver probe Date: Mon, 10 Jun 2019 09:42:07 +0100 Message-Id: <20190610084213.1052-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190610084213.1052-1-lee.jones@linaro.org> References: <20190610084213.1052-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Qualcomm Geni I2C driver currently probes silently which can be confusing when debugging potential issues. Add a low level (INFO) print when each I2C controller is successfully initially set-up. Signed-off-by: Lee Jones Acked-by: Ard Biesheuvel --- drivers/i2c/busses/i2c-qcom-geni.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index 9e3b8a98688d..a89bfce5388e 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -596,6 +596,8 @@ static int geni_i2c_probe(struct platform_device *pdev) return ret; } + dev_dbg(&pdev->dev, "Geni-I2C adaptor successfully added\n"); + return 0; } From patchwork Mon Jun 10 08:42:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 166291 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp758618ilk; Mon, 10 Jun 2019 01:42:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbl1DG9BeqphIk+G22iatozm97dCTPAgNz4aWSFmogG3upiPZ6vgNIZTt4CQ99KfSEIn8+ X-Received: by 2002:a63:3c9:: with SMTP id 192mr9215935pgd.90.1560156149913; Mon, 10 Jun 2019 01:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560156149; cv=none; d=google.com; s=arc-20160816; b=c0GOgA39ePhpU1rQbb5Rm+0JzJbIKM9WhSZmaoJ3eILOcT4DxQybOo/rciZfzdo7Jn P1JfJGI+Euc29MFa8KRS6O9q681j3MQBgLr7Q4i2EXM17xErYoJpPUq66DU/uIp7M2v+ sRFehTcrqUPZNb32Y4R9onXxGIArf3FUUYCPfBCED4dso5sE6sk+inZDgYgS7P6wjeYy JuQTvZV1sgsOZvPViwOVQHYpleSX8cYfCw16K/cO0zbAxRP5ABmVLiHWed2vWhY+BKeQ gxjEHBQ/IeZOMadsE/HxdzabLkh81U5HTv+f/7d/iwJZruxiE78B+M32tRoOIrAyifT2 S2Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=FalRLEADzMPtGyW8NIPAA0F5olxzxXGnPVoGFb+myak=; b=dZDEYMN78cOx9gO5MDKh3t/UyuHqptnK7ptvs3ws3CobgrZuwBLLCtfVB7/fPFfsIm z74IqAir/dtRvDFMLgpWI6oP/F0OIvnALaB8xzS0/66TL8p9DggzqQw/+ehKp3nYxXB7 P/e8mHUoBYMEsncyh0Ry8JxLqHNR2kBZppJ9GByi2md9oc2c9dIUpmeupgR7/RIEHdnS AsmXIQBWRXPKIJN1kwIloYuQwzuaX+w2bQ7fQ1MRHZGvyHaK1SSRaGOKy9SP/mPHJNM8 LPN2+QSRIDPAXdpn24m/gJXRzF6XkQ0TrWWiHUNuuWxqw6t9zckDD1JSmKY7MgBeer2H 2Qcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ErpuCgIK; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cj19si9882295plb.169.2019.06.10.01.42.29; Mon, 10 Jun 2019 01:42:29 -0700 (PDT) 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=@linaro.org header.s=google header.b=ErpuCgIK; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388606AbfFJIm2 (ORCPT + 30 others); Mon, 10 Jun 2019 04:42:28 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40116 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388430AbfFJImZ (ORCPT ); Mon, 10 Jun 2019 04:42:25 -0400 Received: by mail-wm1-f65.google.com with SMTP id v19so7280444wmj.5 for ; Mon, 10 Jun 2019 01:42:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FalRLEADzMPtGyW8NIPAA0F5olxzxXGnPVoGFb+myak=; b=ErpuCgIKx7tdIhXc0Vgq27YYh5IdzYS8ZROzqkhZo992Lvnn19vfhbIqZzxfQ10161 q/yb5S3UOlu7jVewR6gPOHtopPzH2mIm47P8H5DIDXJkkAvu/fVLeYL+XDHodIfbmI/Q CKa9e4AABXjZuSQiUwSxAL/oBnskNHq1jEInWN4Q5Tp+sQdhRKsiH2TxkMt482GTBNR7 aY1rlYW3/QXDuFLndlbV2tpu9/XuFDuowc7j5gTlPoBAZBoUbY32p3JHHxZM6+39iUMi I88QsPzhpoQOgqfRr4ELN1VJv09S0GcBFZHzKYKYqObfTb0uzFEHbnk2tmqKPOZqSUBm gHPQ== 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; bh=FalRLEADzMPtGyW8NIPAA0F5olxzxXGnPVoGFb+myak=; b=Ex6dGnHx1kiXkPhSYzjDklpUJYmlB8QBbofxqYVN7O/n5KAsNIKzNtTfXQgeNkCoFk 5UTrQER+6tOgWrXBqKGKWoTpV/JmuDVGn2g2JJNzcBpAAco93oJCS8gUgwyeu8d/2KEB UCe1Hx8Wt2/y6429le1tQtTXy89WLbQWYtMtp0USXY0xtmwzA4u7dUFrLrcjdE2GqnLm ZqmVSIRkJXyOrAFi7C5uxXfp2a46nFC5gpJrJHstFFz/FazPcCJj2sdH5J/cI/AmwFnq kI/Y+Af12F1Qpu3C8/CRrVPAkqSUYw3qNGopJWOx2UCHKcyU98mYXFNhQhL2X5z6+caU 2sGg== X-Gm-Message-State: APjAAAVV9J9p7KsXZXQb+50A877uItfZQJOw6IwdDX1nT5r8Tjdbv7+d aUo6td+wGMJtUymUYnvYMylB3g== X-Received: by 2002:a1c:35c9:: with SMTP id c192mr12941297wma.147.1560156143556; Mon, 10 Jun 2019 01:42:23 -0700 (PDT) Received: from localhost.localdomain ([2.31.167.229]) by smtp.gmail.com with ESMTPSA id a125sm9929670wmf.42.2019.06.10.01.42.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 01:42:23 -0700 (PDT) From: Lee Jones To: alokc@codeaurora.org, andy.gross@linaro.org, david.brown@linaro.org, wsa+renesas@sang-engineering.com, bjorn.andersson@linaro.org, linus.walleij@linaro.org, balbi@kernel.org, gregkh@linuxfoundation.org, ard.biesheuvel@linaro.org, jlhugo@gmail.com, linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones Subject: [PATCH v3 8/8] usb: dwc3: qcom: Improve error handling Date: Mon, 10 Jun 2019 09:42:13 +0100 Message-Id: <20190610084213.1052-8-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190610084213.1052-1-lee.jones@linaro.org> References: <20190610084213.1052-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org dwc3_qcom_clk_init() is called with of_count_phandle_with_args() as an argument. If of_count_phandle_with_args() returns an error, the number of clocks will be a negative value and will lead to undefined behaviour. Ensure we check for an error before attempting to blindly use the value. Signed-off-by: Lee Jones Reviewed-by: Bjorn Andersson --- drivers/usb/dwc3/dwc3-qcom.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 55ba04254e38..e4dac82abd7d 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -409,6 +409,9 @@ static int dwc3_qcom_clk_init(struct dwc3_qcom *qcom, int count) if (!np || !count) return 0; + if (count < 0) + return count; + qcom->num_clocks = count; qcom->clks = devm_kcalloc(dev, qcom->num_clocks,