Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp556480rdb; Thu, 8 Feb 2024 13:55:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbLrzj7ksopRH6HrjQoB67mUkzUHrjhcmUgK6l9qIrqZAo6fElGHzsrLG8iNvW+9F8WseI X-Received: by 2002:a05:6a00:17a4:b0:6e0:3827:4d23 with SMTP id s36-20020a056a0017a400b006e038274d23mr731719pfg.15.1707429305032; Thu, 08 Feb 2024 13:55:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707429305; cv=pass; d=google.com; s=arc-20160816; b=QSdO53JHmSRIYdDFvd/Z3o64Kcwh0VUo8HHWu6ahHdJlkKhjT65PdLkBzDhoegZoR7 8GbUQZuEQ940ZfvqXHh2Ku7vhFnKPP9V4EMX0bZrEZrbkZ0Wf0okcC1JMC24ew5+XP/a kA5BnPy+rIz2zsyeQlJXx7iwdUbWU47QuSmnh7JQ4cu7wVDjtrHppHX2bnUtqCFd/TUK sMjzqcXnflfXMlboDTRUkmK5KJUn/jL6doh0/GDwD50YpUdTQPbq1ZIs6j12NHJmvAyn ncjdJxmMLx1Q7o4eEHpsod28dt0BQ2XPvFt2eKLiLoGpukMGJ7PXNvCio9RYRLS8E/y4 OzYA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=YXvq4nsTthWnNOvah4CH5HkIfAdpdthoxHgoZBMOdlg=; fh=aPlllmTem8xZAWb0hmfqqWQq+Vqnpv2GLQiysyJcrO0=; b=k9rSMOOjd2ezAOcfblbWFPu/L5weC/baHuJVurAdLLyG2EuwxWYEK3FlgDNgkyuxGF K+aedKkD6cBfEt/O/8VSD9pLx10utUzytiEASQJvZPn4XXy/9OeYldhYBOQgg8A87bDA 6rfOQfDDd17JgwerxYU3JycE9w3yIHZwgCKTBK43mJhDI3BpOJkI7J3QD7QNHj2QGIUo vJ2dIuY3eaLzgvNiPFzKGQknIXajMceTVUBY3RfWBvUMnHqa45T0wrpJ7VfsD4Gw0WmU xumND47bZh8+vxfLNsFko80jLww27wjMFA2zripsSKZEzCv9Ane0F9+PEqhpi3hkavvr 8n8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R3btefzz; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58560-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58560-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCUUWcty3zcQjQHsT4SmeGd0+rOBT7pO5WrMs44QQYNl+JL88Rgrm/DNjeUwHvjVijOLrIzTqUjRDb3huy8tFGYboqGt7ytRBRfEIWPFWg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s18-20020a62e712000000b006e0338e3d3bsi342725pfh.196.2024.02.08.13.55.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 13:55:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58560-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R3btefzz; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58560-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58560-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0641528FBB2 for ; Thu, 8 Feb 2024 18:49:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61F2428DC9; Thu, 8 Feb 2024 18:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="R3btefzz" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD07F2556D; Thu, 8 Feb 2024 18:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707418169; cv=none; b=QID3bS/xMfCKdIA+nzGefU7ztGzolgYpTx4eqTlltASIp/aVEVF63Kh4mNSVk+hmZHa3gxODpEtBcG2Rjwje1vNnHwcOQ8ayP8/5t+ne5Di//swgnJ5iuw1XovF/0Ln4u6BLbagPkCL6+3z95EpIHy0gsYNhVPUbtiamdpdcktg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707418169; c=relaxed/simple; bh=xSKeAKNBA96roisQYOcxV4QilUZU+Ks7Czd6oPoWOHU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HcLMgYOJEkumR2LJj0R1iH1xrnNa2lAvOZ9ILp2CmefqAv5e5MZxV/yK5itE7YijORoMSemzfNIuik+hpWBCZnwH0hPyfrZ7bI+xtSWqmsZIHE6m3PgTC+nyz3dJpbnh/EGG8hBBD0wnX2v1aLGKsfFRv78VzyBDTECNjQIBkE4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=R3btefzz; arc=none smtp.client-ip=192.198.163.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707418168; x=1738954168; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xSKeAKNBA96roisQYOcxV4QilUZU+Ks7Czd6oPoWOHU=; b=R3btefzzCOmPypUcdfnxzpNw3uuaOhiP2dje0z/Jh8UGVUesKjrIq0GW 68F3L2zIGyH3Y2i4w/0cxNEDNQuHDen/FO5djOOwTXKAZjHlAjHsd69Ws yJjqoED7VQa723nZpQ03dOm0FVx/i+HW3aoXGLZ8dPvOA++GslzqMzfrB uE8ahgWVQXKW6fFBPd7mARsKL6BDPf5hFyaDwry25WLRRD8JSQJ6r8Pu0 PtSGtKdHB21CfQnF06xejPbHI2pZ6PePUks/BA9WKnZIIWvazCsPvq/Zy olwQUI23SA6I0ayQqT50iVTMs5gwPeWHljfXdttQd6S453uRtKtmxdll4 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="1186088" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1186088" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 10:49:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="934215514" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="934215514" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 08 Feb 2024 10:49:22 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 557F532F; Thu, 8 Feb 2024 20:49:21 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Miguel Ojeda , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Robin van der Gracht , Paul Burton , Geert Uytterhoeven Subject: [PATCH v1 04/15] auxdisplay: linedisp: Unshadow error codes in ->store() Date: Thu, 8 Feb 2024 20:48:02 +0200 Message-ID: <20240208184919.2224986-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240208184919.2224986-1-andriy.shevchenko@linux.intel.com> References: <20240208184919.2224986-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit kstrtox() may return different error codes. Unshadow them in the ->store() callback to give better error report. While at it, add missing kstrtox.h inclusion. Signed-off-by: Andy Shevchenko --- drivers/auxdisplay/line-display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/auxdisplay/line-display.c b/drivers/auxdisplay/line-display.c index c4dbb13293d1..4b92ae7781f1 100644 --- a/drivers/auxdisplay/line-display.c +++ b/drivers/auxdisplay/line-display.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -166,9 +167,11 @@ static ssize_t scroll_step_ms_store(struct device *dev, { struct linedisp *linedisp = container_of(dev, struct linedisp, dev); unsigned int ms; + int ret; - if (kstrtouint(buf, 10, &ms) != 0) - return -EINVAL; + ret = kstrtouint(buf, 10, &ms); + if (ret) + return ret; linedisp->scroll_rate = msecs_to_jiffies(ms); if (linedisp->message && linedisp->message_len > linedisp->num_chars) { -- 2.43.0.rc1.1.gbec44491f096