Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1332332imu; Wed, 23 Jan 2019 15:09:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN4K4cVd76mjrjOWzb6G83mhHXF2XqfvtF+Jlh8m1qlZLhS5q7K+KHpJD0mIYdipIIGTLsns X-Received: by 2002:a63:104d:: with SMTP id 13mr3772505pgq.303.1548284952756; Wed, 23 Jan 2019 15:09:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548284952; cv=none; d=google.com; s=arc-20160816; b=02wcDrvqaYfCjnChvLBwauLUVLXmqQ4OQQYc1a7FWMjYBjWN+S2RDt690xpdX+tecf 7xMFw0PQvTKtWr81qr79FGQAbtCVYkfjmBAaX1gda0Ke2D0CWV5xUsSEUi3MlNTLAGkm 6fivBnpx1iM6bsk0jbw7owvHypZQpjHd+CTWdR54XSfn99tGVO6sbkfu7TYqG2Vi5cgh ug3sjcA3W9f0H1Efv9sp/ReWRP8jh+PI2xB83AvHvBT/i1NgDL4BmuaULQr8K3c4Ynyg wEs7gCI83y3MvPd7PHx2z1/Y62JXeNmPr7cDrHEkUaHIjBlEhbrqDacvUDXprCXK28kU cZHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject :smtp-origin-cluster:cc:to:smtp-origin-hostname:from :smtp-origin-hostprefix:dkim-signature; bh=iIazPrlt7tOWnA4QOJ1iZhFr3bvbXxhMyXLj+/1AyVo=; b=U4aER5fP3e7STt8X5bV3hzGZ+gXOF6Feal6nHSQ+X/ChVoik8OmkO+uy1ccv+F4kyb A8JxplOt8By0NxXmC5fQ8t3wrTXOv03yOhqjdSV0NpAshyyum+H0McvJlHkpheqtYXxC dkFiyVb95ftSNRwJr9+BdOp6XkzjNz6ejHWOgmmNhfHXOPyxcL06ffDhEO/KR/8aMzPg tGAJvKYDSbJrh6tIdYrXraPoh6aq6tQ9L0EFVDOoRqaKIrDxU0aCRvkybsHvIdV/brmr N2xnh9X4LDi8hH8cwY9lq7CerfnFLG2DXyuZplkVH/9cCZbxX9tEE0QqYmwa6TV23/1e mZwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=AtGo2odd; 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=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15si19997783plm.431.2019.01.23.15.08.56; Wed, 23 Jan 2019 15:09:12 -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=@fb.com header.s=facebook header.b=AtGo2odd; 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=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726346AbfAWXHP (ORCPT + 99 others); Wed, 23 Jan 2019 18:07:15 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:52078 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbfAWXHP (ORCPT ); Wed, 23 Jan 2019 18:07:15 -0500 Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0NN0Bm6028150 for ; Wed, 23 Jan 2019 15:07:14 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=iIazPrlt7tOWnA4QOJ1iZhFr3bvbXxhMyXLj+/1AyVo=; b=AtGo2oddJtBfGaHVrMHnXcRqotFi4HNVwUh21Avcd03wvNjj59JfPn/fMCmBTVO/Z6hi wqNB2xlfeGvUSI06D3lfq4P56cmkDf0vOQcdjeKIe9nK0UEBV0ewszB4/YvXYIQskYcV gLq+81zWN6rBlX/e6ofhdScTgPo8mRZrxA4= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2q700arah0-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 23 Jan 2019 15:07:14 -0800 Received: from mx-out.facebook.com (2620:10d:c0a1:3::13) by mail.thefacebook.com (2620:10d:c021:18::172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.1.1531.3; Wed, 23 Jan 2019 15:06:38 -0800 Received: by devvm4117.prn2.facebook.com (Postfix, from userid 167582) id 48A96861B012; Wed, 23 Jan 2019 15:06:36 -0800 (PST) Smtp-Origin-Hostprefix: devvm From: Vijay Khemka Smtp-Origin-Hostname: devvm4117.prn2.facebook.com To: Arnd Bergmann , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , , , CC: , "openbmc @ lists . ozlabs . org" Smtp-Origin-Cluster: prn2c23 Subject: [PATCH] misc: aspeed-lpc-ctrl: Correct return values Date: Wed, 23 Jan 2019 15:06:34 -0800 Message-ID: <20190123230634.1815021-1-vijaykhemka@fb.com> X-Mailer: git-send-email 2.17.1 X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-23_11:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"); + 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"); + return -ENXIO; } addr = lpc_ctrl->pnor_base; size = lpc_ctrl->pnor_size; } else if (map.window_type == ASPEED_LPC_CTRL_WINDOW_MEMORY) { /* 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"); + return -ENXIO; } addr = lpc_ctrl->mem_base; size = lpc_ctrl->mem_size; @@ -239,7 +238,7 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev) of_node_put(node); if (rc) { dev_err(dev, "Couldn't address to resource for reserved memory\n"); - return -ENOMEM; + return -ENXIO; } lpc_ctrl->mem_size = resource_size(&resm); -- 2.17.1