Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6587387yba; Wed, 1 May 2019 15:39:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQKWooTBTC3KNOwL5GDfpcpV1TmnZpliU5O0RRIqN+DmGHQwOoHejXTeITKlfWusfwmlVw X-Received: by 2002:a62:d5c9:: with SMTP id d192mr439922pfg.109.1556750387196; Wed, 01 May 2019 15:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556750387; cv=none; d=google.com; s=arc-20160816; b=ZaAQfryNJyPbdxHw6diCoWpoIVU94RVwMD4db3cio7IUQUcCl/jJEM4UK5LDn4zDoy pwJyRY9l/fq+pk5NzH+BMg4/JaOceC2RqKeAv/nEv08QdI3j55ATSP0tDkGRqsNKEVai 4TpMftNknfzk4FhvQCAAD1HvJzegMiNQrXdHC27iSqJ39HhBVuxSX9GahLsKtypb5FWM zz9cLKt5Ps9k6QVVw8lYVSYPtyRxSy/AhKMEgcLwktiKNlX0r9P6v5wIV/QvzOwB/m9r oYHrviVH5KbJJ4ruXBSzgH6CakRc9pja8HmeUh+nfm1Ae4a4ssl4iL7VcAAhO8gfaoua Nz5A== 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=F/0csqDKgwjmz0/17HWw4juG25nuDAYs92m0oeupLRRqEWx3gPKg5Fv4KEo5C/Edzx VPJ9IItZKOA1A4EPh6hwzZjLEGQDS98OTA7II4cPBVEWUSLED6lT1OwbIwRmcykPcpZO tow0Iy0Bpm+KfK+NI8+BHyPsCTs93dBntQd/io1Xx4arykABV7Lg+VIcbG3U9GycRooH QW8cQ6iKDkfoLQUQ/n3Q3sf4WMgDSmkBsbX56QsyNkxCBqjURWojt2YHS/IblHdpiPwy yDbf59cFo1q5mTXEdk8bMxgaaKcf94AwOvF049flr/TPHRJco9HHhwaqDMB2XMnedpVo 0MoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b="j8s/grND"; 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 d12si10469806pll.94.2019.05.01.15.39.31; Wed, 01 May 2019 15:39:47 -0700 (PDT) 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="j8s/grND"; 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 S1726207AbfEAWim (ORCPT + 99 others); Wed, 1 May 2019 18:38:42 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:40666 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726144AbfEAWil (ORCPT ); Wed, 1 May 2019 18:38:41 -0400 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.27/8.16.0.27) with SMTP id x41MYNdW004293 for ; Wed, 1 May 2019 15:38:40 -0700 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=j8s/grND7dbtTkbGg4Oidn9G/lEmLB02oSc61IkhyEn3fGtswvwxqTDQrbR3yMYO++fH GKRJBJ8SlfhOrFRRYkZFht5+pf4oQOPYmsukdQOAxG3SW26cY5DXPhTBf76pX0bYx/3A 0JmjbboaRFUQr6QNa+Ecx4SUhq2FKPjo+cA= Received: from mail.thefacebook.com (mailout.thefacebook.com [199.201.64.23]) by m0089730.ppops.net with ESMTP id 2s7d0q1mhn-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 01 May 2019 15:38:40 -0700 Received: from mx-out.facebook.com (2620:10d:c081:10::13) by mail.thefacebook.com (2620:10d:c081:35::125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.1.1713.5; Wed, 1 May 2019 15:38:38 -0700 Received: by devvm4117.prn2.facebook.com (Postfix, from userid 167582) id 8A7AAD5ED26F; Wed, 1 May 2019 15:38:38 -0700 (PDT) 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: , Smtp-Origin-Cluster: prn2c23 Subject: [PATCH] misc: aspeed-lpc-ctrl: Correct return values Date: Wed, 1 May 2019 15:38:36 -0700 Message-ID: <20190501223836.1670096-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-05-01_10:,, 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