From patchwork Tue May 25 19:52:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 102284 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4PJqIpL001741 for ; Tue, 25 May 2010 19:52:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758735Ab0EYTwR (ORCPT ); Tue, 25 May 2010 15:52:17 -0400 Received: from mail-px0-f174.google.com ([209.85.212.174]:59077 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758317Ab0EYTwQ (ORCPT ); Tue, 25 May 2010 15:52:16 -0400 Received: by pxi18 with SMTP id 18so2128870pxi.19 for ; Tue, 25 May 2010 12:52:15 -0700 (PDT) Received: by 10.114.16.13 with SMTP id 13mr6604999wap.217.1274817135390; Tue, 25 May 2010 12:52:15 -0700 (PDT) Received: from localhost (c-24-18-179-55.hsd1.wa.comcast.net [24.18.179.55]) by mx.google.com with ESMTPS id 33sm50259836wad.20.2010.05.25.12.52.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 25 May 2010 12:52:14 -0700 (PDT) To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-omap@vger.kernel.org, Michael Roth , Pavel Machek , Andrew Morton , Mike Frysinger , linux-kernel@vger.kernel.org Subject: Re: [PATCH] touchscreen: ads7846: please don't touch free'd memory References: <1274226413-8520-1-git-send-email-khilman@deeprootsystems.com> <20100519000019.GA17475@core.coreip.homeip.net> From: Kevin Hilman Organization: Deep Root Systems, LLC Date: Tue, 25 May 2010 12:52:12 -0700 In-Reply-To: <20100519000019.GA17475@core.coreip.homeip.net> (Dmitry Torokhov's message of "Tue\, 18 May 2010 17\:00\:20 -0700") Message-ID: <87mxvnlpxv.fsf@deeprootsystems.com> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 25 May 2010 19:52:18 +0000 (UTC) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index b3a1f92..42d4d26 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -175,6 +175,8 @@ static void spi_drv_shutdown(struct device *dev) */ int spi_register_driver(struct spi_driver *sdrv) { + int ret; + sdrv->driver.bus = &spi_bus_type; if (sdrv->probe) sdrv->driver.probe = spi_drv_probe; @@ -182,7 +184,12 @@ int spi_register_driver(struct spi_driver *sdrv) sdrv->driver.remove = spi_drv_remove; if (sdrv->shutdown) sdrv->driver.shutdown = spi_drv_shutdown; - return driver_register(&sdrv->driver); + + ret = driver_register(&sdrv->driver); + if (!ret) + driver_unregister(&sdrv->driver); + + return ret; } EXPORT_SYMBOL_GPL(spi_register_driver);