Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1720062imu; Thu, 24 Jan 2019 00:17:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN5gzYOneT6VXfteDUJ2x1kDiun97r4FhViiwYAj26eY3FnpTXaRfESwyLSUPBSNwyz7wZ3i X-Received: by 2002:a17:902:227:: with SMTP id 36mr5681375plc.140.1548317820252; Thu, 24 Jan 2019 00:17:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548317820; cv=none; d=google.com; s=arc-20160816; b=rrLYUuvZerDaCuLNyvO4PndgJSoRUQRiUbLylehkMx4EgajirTrcMBpkR+V47wntGd gSzP0biwCRiSxyWoJyvTm7Go61IGD9wnZkKB+o67qMQ7/thniYoedZCPOOh0AVkRxHe6 GYGBuKWKto5ptFOPADl7Q5nfIF1anwtCqFGSSOFNkUiiGt9Ac3wA7STjHIzqSM8pzREZ 597xGGq64P/di8JncGeBDfKWHwGiBEU4IgTkPnERSwzlsov27b/3fC+IrAh4pklBtE7i 575Kaa9CK4/3+jUjAQEvII7ie/O4yMphdN+uJ99CUEmlQObp6MJ5kSwyieFE8yITiPtp w8/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8NW8I+yw+pdlJFn3wUiGEErYABZXqFAHntpkbMAZQC4=; b=0J+ndMIXBjrwaewQ6l0rVAF6sd1gxL6yb96sbUGi+FmEuWU0vjwS/h6/q0DG4CYT92 GTXpR2/zCHr53Yh+C4svrPKvjnM+zu6d4vwVIcrL3W/Da0OINhTrCWdF7kLPHUHoh04w njExzgQmr7hHWDIBbVPzOodMViaeZtRptxHbr2ar/N/pkqU8TOnQ0vMm5B7zwoWarm2I BTgsJK6RAdvfgCerWdlp8Z90C3pP3NgZ3mA8Cq1hrGU+pGy1VTvjN+BW7ZtkWxQVW5u9 0slbxvFW1b4H61ljMXM28LI73fkU2NRH0gbOV+G0nXL6GA4NmC+z4x4ig84FSxVJ9/2f Ki9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="G6XQ/Dwk"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x16si13294988pga.407.2019.01.24.00.16.45; Thu, 24 Jan 2019 00:17:00 -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=@kernel.org header.s=default header.b="G6XQ/Dwk"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727530AbfAXIPt (ORCPT + 99 others); Thu, 24 Jan 2019 03:15:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:56636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727128AbfAXIPs (ORCPT ); Thu, 24 Jan 2019 03:15:48 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C60B8218A2; Thu, 24 Jan 2019 08:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548317747; bh=ack29QH4xqRdXg+FVs9les4gl/Bcp4LrSb/D2S89Qf8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G6XQ/DwkiqVqjaAYRHADEzoPJ6HbUR1abxElBsQltof83rQv4Q4/18R4jju1F+x1L o9I0TtSQSwSbge6XiVim1GoQhkJTeTuwDzUQg7rXFIz8mJFwy0vGKZoChJu62bjLFp 6oPp0YdpsUbxQUma27u4x06Ysf4A4uj1vyLmycVo= Date: Thu, 24 Jan 2019 09:15:44 +0100 From: Greg Kroah-Hartman To: Vijay Khemka Cc: Arnd Bergmann , Joel Stanley , Andrew Jeffery , linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, "openbmc @ lists . ozlabs . org" Subject: Re: [PATCH] misc: aspeed-lpc-ctrl: Correct return values Message-ID: <20190124081544.GA1649@kroah.com> References: <20190123230634.1815021-1-vijaykhemka@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190123230634.1815021-1-vijaykhemka@fb.com> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 23, 2019 at 03:06:34PM -0800, Vijay Khemka wrote: > Corrected some of return values with appropriate meanings. > > Signed-off-by: Vijay Khemka > --- > drivers/misc/aspeed-lpc-ctrl.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > > diff --git a/drivers/misc/aspeed-lpc-ctrl.c b/drivers/misc/aspeed-lpc-ctrl.c > index 332210e06e98..97ae341109d5 100644 > --- a/drivers/misc/aspeed-lpc-ctrl.c > +++ b/drivers/misc/aspeed-lpc-ctrl.c > @@ -68,7 +68,6 @@ static long aspeed_lpc_ctrl_ioctl(struct file *file, unsigned int cmd, > unsigned long param) > { > struct aspeed_lpc_ctrl *lpc_ctrl = file_aspeed_lpc_ctrl(file); > - struct device *dev = file->private_data; > void __user *p = (void __user *)param; > struct aspeed_lpc_ctrl_mapping map; > u32 addr; > @@ -93,8 +92,8 @@ static long aspeed_lpc_ctrl_ioctl(struct file *file, unsigned int cmd, > > /* If memory-region is not described in device tree */ > if (!lpc_ctrl->mem_size) { > - dev_err(dev, "Didn't find reserved memory\n"); > - return -EINVAL; > + pr_err("aspeed_lpc_ctrl: ioctl: Didn't find reserved memory\n"); Why did you change from dev_err() to pr_err()? You just lost a lot of information that the user previously was getting from dev_err() :( > + return -ENXIO; > } > > map.size = lpc_ctrl->mem_size; > @@ -134,16 +133,16 @@ static long aspeed_lpc_ctrl_ioctl(struct file *file, unsigned int cmd, > > if (map.window_type == ASPEED_LPC_CTRL_WINDOW_FLASH) { > if (!lpc_ctrl->pnor_size) { > - dev_err(dev, "Didn't find host pnor flash\n"); > - return -EINVAL; > + pr_err("aspeed_lpc_ctrl: ioctl: Didn't find host pnor flash\n"); Again, don't do that :( thanks, greg k-h