From patchwork Fri Dec 21 19:29:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 1905641 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork1.kernel.org (Postfix) with ESMTP id 8331F3FC64 for ; Sat, 22 Dec 2012 09:49:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1TmLi4-0000ZT-DF; Sat, 22 Dec 2012 09:49:36 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1TmLi2-0000ZN-4y for spi-devel-general@lists.sourceforge.net; Sat, 22 Dec 2012 09:49:34 +0000 X-ACL-Warn: Received: from mail-pa0-f43.google.com ([209.85.220.43]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1TmLhw-0003XO-HF for spi-devel-general@lists.sourceforge.net; Sat, 22 Dec 2012 09:49:34 +0000 Received: by mail-pa0-f43.google.com with SMTP id fb10so3287875pad.2 for ; Sat, 22 Dec 2012 01:49:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:subject:to:cc:in-reply-to:references:date :message-id:x-gm-message-state; bh=WQzugAjUe3AoRT4TXYb6vf9wHap2w45DwcWXgax+0Dg=; b=LgMr5z7Huf3c8xIQ8wd6qa6aORQMOdnnCQ0eae/ueqJBFAsVkGFbWAM1zSyblinRD5 3WwapcXut5KmOxI5c74xOnTJqmcXiZI/QwYfc7PPWPECXWzXWloGioE6BJw+oXJNHSgp Ga+jWAv+TeRDCLJr+/7CjfSlTgAwqknp0D3hWcClTwL5xN25d8cJa6fm8DT5ciWYapcj O+0SXXjtDhNI9nx5LI8IBBOOcCjNKYki0WdwJ6AXfcx7oG8KkTyzV2ZWI70cLv42pV8i R1r0vyRSop7By3h+Aa0/hryvGL8NOk2bXBTjDwBoq1O0a03rT4r6CLcn9S3NWY3IsT0s kaug== X-Received: by 10.69.1.9 with SMTP id bc9mr47522037pbd.61.1356169434184; Sat, 22 Dec 2012 01:43:54 -0800 (PST) Received: from localhost ([194.72.72.170]) by mx.google.com with ESMTPS id ol4sm8558699pbb.58.2012.12.22.01.43.51 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 22 Dec 2012 01:43:52 -0800 (PST) Received: by localhost (Postfix, from userid 1000) id 77D523E03CE; Fri, 21 Dec 2012 19:29:14 +0000 (GMT) From: Grant Likely Subject: Re: [PATCH] spi: spi-mpc512x-psc: don't use obsolet cell-index property To: Anatolij Gustschin In-Reply-To: References: <1356100981-18685-1-git-send-email-agust@denx.de> Date: Fri, 21 Dec 2012 19:29:14 +0000 Message-Id: <20121221192914.77D523E03CE@localhost> X-Gm-Message-State: ALoCoQm0nnkoPP5jlHmqLu4JOTq1Krb81Eed9Yp1+b3O/R4mrKRUpTyYdAqkHe571YGQhZvt+Csp X-Spam-Score: 0.8 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.8 DATE_IN_PAST_12_24 Date: is 12 to 24 hours before Received: date X-Headers-End: 1TmLhw-0003XO-HF Cc: spi-devel-general@lists.sourceforge.net X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net On Fri, 21 Dec 2012 14:48:38 +0000, Grant Likely wrote: > On Fri, Dec 21, 2012 at 2:43 PM, Anatolij Gustschin wrote: > > Use unique PSCx register base offset to obtain the > > SPI PSC number used for SPI bus id. > > > > Signed-off-by: Anatolij Gustschin > > Don't do this. If you really want to assign a specific bus number, > then use a property in /aliases. cell-index has been deprecated a very > long time ago now. Ummm.. I really should read patches before I reply to them. I see you're removing cell-index, not adding it back in. It is fine. Aliases would be a more generic solution though. Would this following change work for you? Try it out and let me know. g. --- ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 84c2861..de9f6ee 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -983,6 +983,9 @@ int spi_register_master(struct spi_master *master) if (master->num_chipselect == 0) return -EINVAL; + if ((master->bus_num < 0) && master->dev.of_node) + master->bus_num = of_alias_get_id(master->dev.of_node, "spi"); + /* convention: dynamically assigned bus IDs count down from the max */ if (master->bus_num < 0) { /* FIXME switch to an IDR based scheme, something like