Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp580624rdb; Thu, 8 Feb 2024 14:52:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUkLgPgXyuzXe5eZImKO/Z7v1dkoqSRbsjS6wflqURDVBRHvHyEbqTA9pvjlnNr8EhRWmU3vf9dlBD51UnOkW7xd1/zdpeppURi5apOcw== X-Google-Smtp-Source: AGHT+IHBhm55RMMI0OV06FiwOQOvzE2q9IRzioOCjBTaqUeRMOD+72tvffUMKi9vqaHfemR/rO3T X-Received: by 2002:aa7:d957:0:b0:560:590:10b9 with SMTP id l23-20020aa7d957000000b00560059010b9mr4218eds.2.1707432737447; Thu, 08 Feb 2024 14:52:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707432737; cv=pass; d=google.com; s=arc-20160816; b=yGLKKW5N26Y1IZKeDQQdNKlLKZlw7s3P3Qn3oPDgxVoEsXjeK7OnLrV/qldOjQKska n4qxtm+lLIJIpUr1zDDPNzhx+u+vjP73bCR6kz5WvQnIkjWW/ycg5u4g5N6VFKxv2xzb kkwV7ad/TYUkaqxlxiHdqri2z9NAWn57Nt6K8h5zN0J07ayb+uVNS+l0pzBk+ZhSFAjp IGbvoPDqiLLhESQwdB+6rXkTWXImMz8kFiHf5dqvlspJnroug91XdaLmod/EHfAgLVvz 29HO8XWcOtqQL0UjuUiQjwXbTnO86bj1ELNKB+k9QONSoL0EcqmWSpkGklFDe/KTfD/H 1ZOg== 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=/BFDDNH3E+09O/CQii7q7OeLIy/2qGcXOO4bKpf5Idg=; b=qWVjYW3kT16eduFwODYVxFwUdwHQZUtUcKFJq5sje1hqHENGlNrZEms8cetqpk1FAf S9PFfZPsViDgeW0OPl7I/b1zr/k6QWOKGLXOuF/D5IU9rCVHZ43qm7G8XLOzvQxRWEIH NaxGBA7W+Lu/lnZF6crJFGdwD3D1tTquLVtKxmmiPJC2wu4cof+kHiR6SBdThapkGZeo 66O16tF7iP3vB1Nelc94BiyB/fwAhAWlA2yv1pO7maNnkGPJRhvtWAfQV2Pi0ddpkf2B MgJwfaFFLCQiabGB4fhsPCqzBF83b2+w5o8ugVzoZjU7Kl2pb8/6dUS+RDVXP97dVO4k eUQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="UR/MFjBi"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58554-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58554-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; AJvYcCWzNiLT0Z8/QrIrKAC2iP+waZTc/fgZU+XYsCFwfPNpBuL0pD6XJNJhDkhV9iGMMTKVgcTb+TTNVNMGYkP2UHU2lonFvgFL24YpineN3g== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t25-20020a508d59000000b00560530cc737si166984edt.653.2024.02.08.14.52.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 14:52:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58554-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="UR/MFjBi"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58554-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58554-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C55A51F2D06C for ; Thu, 8 Feb 2024 18:46:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0AB12D05B; Thu, 8 Feb 2024 18:45:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UR/MFjBi" 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 91E012562A; Thu, 8 Feb 2024 18:45:56 +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=1707417958; cv=none; b=A5S33koOkNEhDdhV33tGykQnwNVvn5WE0bX/5DcttMtrUZffbeLwxTpfpccUw89DQYIM5aeaIcL/30Nv/dk9RVXAVZgYqk/U5pxtOess7h61W/HxDNu3jPXWCzSYRIqaBdAL5Nil/quyRHDWBXLwWF0w+n80CFX9rSpJxzyn79U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707417958; c=relaxed/simple; bh=xSKeAKNBA96roisQYOcxV4QilUZU+Ks7Czd6oPoWOHU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mhVTXmIHPj3Tvo4hXEnhtAAJPeHoHAxCAkANgmq9xXp9gv92nwVJscXrbjDkGKPmyJ9Wau1AIrYPbAy1SK+85VEoQIDHBImrHNBo25/3PUtQkXBBGeOi1L2vNixf2kTv+aUW2e1DBtBzs8RXjTt4A7LWvCQaj38Jc7mZ/4wa1kk= 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=UR/MFjBi; 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=1707417957; x=1738953957; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xSKeAKNBA96roisQYOcxV4QilUZU+Ks7Czd6oPoWOHU=; b=UR/MFjBiVReft1FQ0unS0YgCo3WyzG1AsdBR2ipGEozVVzBEaP7AMokA aF4MOXbDk5nSN5gTq5ZbXNELDROb9f9sEkPYj0ius5gyBhP+Jd6IETXgY d4oVA4lRZ/cDpDkOOb3L93vyTvxDK7na0rSyNiC/ezP9u4Zcim9qgJt7f 6HtJwouQYMfNKGjI4benqvhr0m3SZDJ0rL1Hq4QLl6gtvwommtS3FRWO8 CPie1DYG7GD3DYmIA6zq4MYLCHNTZU18Xh2ZLo/giAwKDNxnAI8uF3N4Z 5sVDdXuRtkH/XtwVJKoe8PaXFKMVJvIGaXHpQZw6j92ePBihfYTN5b71M w==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="1185260" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1185260" 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:45:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="934214478" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="934214478" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 08 Feb 2024 10:45:51 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 397BF142C; Thu, 8 Feb 2024 18:59:41 +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 18:58:47 +0200 Message-ID: <20240208165937.2221193-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240208165937.2221193-1-andriy.shevchenko@linux.intel.com> References: <20240208165937.2221193-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