From patchwork Wed Apr 8 11:20:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 459198 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 08FC61401AD for ; Wed, 8 Apr 2015 21:22:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=JtXxuARP; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753827AbbDHLVi (ORCPT ); Wed, 8 Apr 2015 07:21:38 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:36262 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753680AbbDHLVb (ORCPT ); Wed, 8 Apr 2015 07:21:31 -0400 Received: by pabsx10 with SMTP id sx10so111810206pab.3; Wed, 08 Apr 2015 04:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h14KNigQcfZMjAzPWVwmpALCfcSYHSv2oxWUBvYTU3A=; b=JtXxuARPWuvaSEgL9+N772KDubhqMi2Yd7+iavppHqeMi8UNcwhopWkhe2SytzZsk4 GnA1xRMXt9ueKlPZIZxHQX8OgIyyweFW8RRY5ABMrzgY70sqp1/5FKrAaxWLu8/+SRmv 19Hl/gXt9fj7SXYMiCOixui911ptJfGKwxUoPXytR0kPzvXV+B2idxeR2bBSh6Xm96Yj GK3XS5Wh9OXupnBNdHqNrOFqy1e2IXa7E/dKHsxDhU+OqcJUHt4pzkvEWMXXgpC0KHOI gA7r9VM6NR2zL8ISZDG1VmJ01h89n5BZ+4qXXIkPLNCMaOYnOGjj653HhzVSN/6C7emY nJ3Q== X-Received: by 10.70.88.237 with SMTP id bj13mr46039172pdb.160.1428492090993; Wed, 08 Apr 2015 04:21:30 -0700 (PDT) Received: from localhost.localdomain ([122.169.147.27]) by mx.google.com with ESMTPSA id og11sm10973411pdb.91.2015.04.08.04.21.25 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Apr 2015 04:21:30 -0700 (PDT) From: Sudip Mukherjee To: Arnd Bergmann , Greg Kroah-Hartman , Jean Delvare , Wolfram Sang , Rodolfo Giometti , "James E.J. Bottomley" , Mark Brown , Willy Tarreau , Jaroslav Kysela , Takashi Iwai Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, netdev@vger.kernel.org, linux-scsi@vger.kernel.org, linux-spi@vger.kernel.org, devel@driverdev.osuosl.org, alsa-devel@alsa-project.org, Sudip Mukherjee Subject: [PATCH 05/14] spi: lm70llp: return proper error values from attach Date: Wed, 8 Apr 2015 16:50:31 +0530 Message-Id: <1428492040-5581-6-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1428492040-5581-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1428492040-5581-1-git-send-email-sudipm.mukherjee@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org now that we are monitoring the return value from attach, make the required changes to return proper value from its attach function. Signed-off-by: Sudip Mukherjee --- drivers/spi/spi-lm70llp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c index ba72347..9b0fde1 100644 --- a/drivers/spi/spi-lm70llp.c +++ b/drivers/spi/spi-lm70llp.c @@ -190,7 +190,7 @@ static u32 lm70_txrx(struct spi_device *spi, unsigned nsecs, u32 word, u8 bits) return bitbang_txrx_be_cpha0(spi, nsecs, 0, 0, word, bits); } -static void spi_lm70llp_attach(struct parport *p) +static int spi_lm70llp_attach(struct parport *p) { struct pardevice *pd; struct spi_lm70llp *pp; @@ -201,7 +201,7 @@ static void spi_lm70llp_attach(struct parport *p) printk(KERN_WARNING "%s: spi_lm70llp instance already loaded. Aborting.\n", DRVNAME); - return; + return -EALREADY; } /* TODO: this just _assumes_ a lm70 is there ... no probe; @@ -281,7 +281,7 @@ static void spi_lm70llp_attach(struct parport *p) pp->spidev_lm70->bits_per_word = 8; lm70llp = pp; - return; + return 0; out_bitbang_stop: spi_bitbang_stop(&pp->bitbang); @@ -296,6 +296,7 @@ out_free_master: (void) spi_master_put(master); out_fail: pr_info("%s: spi_lm70llp probe fail, status %d\n", DRVNAME, status); + return status; } static void spi_lm70llp_detach(struct parport *p)