Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2753886imj; Mon, 18 Feb 2019 11:33:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IY1GG/CXeqE4XVSLtshWuzN36cHRdui35xK1nWcZTm9sxRrRY4EYUro2upNMpySbxrtQxQk X-Received: by 2002:a65:6219:: with SMTP id d25mr20325827pgv.18.1550518396304; Mon, 18 Feb 2019 11:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550518396; cv=none; d=google.com; s=arc-20160816; b=cYn8D8Ws7v2H3EFLDdLJ+Yyb1FFOjmzFyuCM0SrFv3IqCaif+h2NMVZ+qpcDZlb9jA L5yX/PlWk+wlH+9vOKBT37z8uVQOyALFl8+deFyEUz9/rF7ipxAGtIEjaGx3i87MPqqp 5OAqkAqwgx+BzaW1NiqzjHhOyq8gWdJKAZFPpS+dURDzUb5X1qiJQshzcLbEbOBv4Ux/ N1pGiT+BodLrinVrYD84zzFl0S0ZC7D5eaS7bogHvL9aexf+EknwLFnqd9Vg8/Jzs/1Z Yk65Acov7dvfgaQ3Y7A6Cmtfo8YP1IKk5Fa0mU1uynmbu8GOngWLX08Mak5MhoUEJdpP eAHw== 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=G1jRqsHlDGlfrRFhbWZQqLMZ680TUhIKscck8kcbiSU=; b=W22a4Oi7BX9DkwgA6D5Z3g4o+fR22rOvitNKlUZMTbIALu8/vdmniJFzzMpfVEInrB qImofZP1wxS/t1LRLi42Mnj6zNjKasKFitU9mbwgg0kr3doTmR44yAphH5pjppc3+9iT Usq2nhK6+VkDgDuN9/rg/WBoaB1PpyceGi4V9gTKxPxdFSKQFBzVsNko/I8o+lwSI07x pyPvfdN3GX/elXNY4EtICDaHX7YRR8PE2Dp98RtpVs3hrS+HM4t/m3jCOQfPhCHwk4rm Pb+Z5bNXOT6u7YKeEOJZnDj9ohltfJIYhLuiIj1Uc8ApjQpOcL4AHK1rJTG5W53qqyEn gBEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Q8eiJykZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si13743688pgl.152.2019.02.18.11.33.00; Mon, 18 Feb 2019 11:33:16 -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=@gmail.com header.s=20161025 header.b=Q8eiJykZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728809AbfBRTMS (ORCPT + 99 others); Mon, 18 Feb 2019 14:12:18 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37970 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728758AbfBRTMP (ORCPT ); Mon, 18 Feb 2019 14:12:15 -0500 Received: by mail-pg1-f194.google.com with SMTP id m2so6654430pgl.5; Mon, 18 Feb 2019 11:12:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G1jRqsHlDGlfrRFhbWZQqLMZ680TUhIKscck8kcbiSU=; b=Q8eiJykZtSLT+d69UN4B790ZzCfZZovk3nGCaXT8HYH/htuoyAsOulgFAI3C/LXEGe pxUyOFxT3NVQe7KjFLVd8tkEVkdc335QacVr27/U2k+RChsqTH89rOWu1z/0obPpQc12 wQBvWRl/NythEt16frnFBtAbBJaVkXfS1IQnChjQGzXvy1dtO0x+MXePH93j+OnvVhhd zppRFrtR7CR18UQp1hblTECwjA+d7gA/MfyOaDkYEH5jR5qbKdrO61zjhlV5NTiDsO5i oGkushi9Do3NpVVcjDM3Z5fdOQiJk05eFZE/dUB5sHbUM0bIGVZcdYtwsfpN7qE9z1WT 8LyA== 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=G1jRqsHlDGlfrRFhbWZQqLMZ680TUhIKscck8kcbiSU=; b=b+K2wNqJHYXlOLjY77VfkMwU2oWjVWY4wkhqPzg7kHiTuvQgpsDM7iODveHr/i60KG Fgnt3fKfEHF+cgP6CpRqy7y3Tf1HzXnDX0yVuy1HVLowvcwfYy/42b4HvYUfjRzJncZf 4Uoq0nEEU5qxbW/q0XUWUX4rZ4L3VhqU+YRsIc2aBd41NXCzG5JKYztk2uWsH+e+h/9T zHundTik7kTwVzUVl9JUXaLa6o6BqBfX1ERfM41oWHRWNvDFOD2bzlfm1ZWs/LYVFhFL Ehs01aWFKaz3EOiP7EMveXQRPetYdv/8Z8nMRs1RrjGwsxNYcSJe8TMzEUY04tCXngSI k2Qg== X-Gm-Message-State: AHQUAuajfrFWl0nT2KtNVd/KswMzrByczLtdRso3tFlg0p7IzxTbIjDT ggaYo1p7OXIAnPix32w87kXC+nVp X-Received: by 2002:a63:8948:: with SMTP id v69mr20527767pgd.140.1550517133699; Mon, 18 Feb 2019 11:12:13 -0800 (PST) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id t12sm33189727pgq.68.2019.02.18.11.12.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Feb 2019 11:12:12 -0800 (PST) From: Andrey Smirnov To: linux-pm@vger.kernel.org Cc: Andrey Smirnov , Chris Healy , Lucas Stach , Zhang Rui , Eduardo Valentin , Daniel Lezcano , linux-imx@nxp.com, linux-kernel@vger.kernel.org Subject: [PATCH 11/12] thermal: qoriq: Be more strict when parsing "thermal-sensors" Date: Mon, 18 Feb 2019 11:11:40 -0800 Message-Id: <20190218191141.3729-12-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218191141.3729-1-andrew.smirnov@gmail.com> References: <20190218191141.3729-1-andrew.smirnov@gmail.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 As per Documentation/devicetree/bindings/thermal/qoriq-thermal.txt thermal-sensor-cells _must_ be 1, so there is no reason to be more lenient in the code and treat the absence of argument in thermal-sensors specifier as a valid DT code. Drop that special case to simplify sensor ID retreival code. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-imx@nxp.com Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/thermal/qoriq_thermal.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index d4f5e180e1ee..f746c62789b0 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -82,14 +82,14 @@ static int qoriq_tmu_get_sensor_id(void) goto out; } - if (sensor_specs.args_count >= 1) { - id = sensor_specs.args[0]; - WARN(sensor_specs.args_count > 1, - "%pOFn: too many cells in sensor specifier %d\n", - sensor_specs.np, sensor_specs.args_count); - } else { - id = 0; + if (sensor_specs.args_count != 1) { + pr_err("%pOFn: Invalid number of cells in sensor specifier %d\n", + sensor_specs.np, sensor_specs.args_count); + id = -EINVAL; + goto out; } + + id = sensor_specs.args[0]; out: of_node_put(np); of_node_put(sensor_np); -- 2.20.1