From patchwork Fri May 1 14:22:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 21453 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n41EMJbk016704 for ; Fri, 1 May 2009 14:22:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755602AbZEAOWR (ORCPT ); Fri, 1 May 2009 10:22:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755743AbZEAOWR (ORCPT ); Fri, 1 May 2009 10:22:17 -0400 Received: from mail-bw0-f163.google.com ([209.85.218.163]:47590 "EHLO mail-bw0-f163.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755602AbZEAOWQ (ORCPT ); Fri, 1 May 2009 10:22:16 -0400 Received: by bwz7 with SMTP id 7so2334742bwz.37 for ; Fri, 01 May 2009 07:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=nrHJYg5YAHhYrZ+D+oygTa6EyfG58Wc+HrE/0xbgCdk=; b=wXy/eF437ULTqZ5sIhplf+X6wIjI/233ik0R8ae6p0fCeH0tFv9TFrWC9QHgh4nd+L 6h07IqZfX+cBJPdJLVoNT5QhZK9tJftw0UKUJvpi7wYAL7wt4dE28LEa7IxGsKNPQKsY gvRcO0qdK4Z+KwUROaUiUrpLao40WNfviLpaE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=M+lDDIVsaSAK2moDWEybz8qlBZfdfbFijSAKtlylzEoGfkM0Jv2BQA5zVeCeFAmqDd udztNjKBgT2DJyqEUSeU4Li0ATqOcBqHKTET/KjM/EM9xhOvknyKg5X3wYwpExIiewZ3 RvF9aU6InrqS9qBA3CsQls7PT3335kqKAQx/0= Received: by 10.103.217.5 with SMTP id u5mr1675079muq.42.1241187735219; Fri, 01 May 2009 07:22:15 -0700 (PDT) Received: from localhost.localdomain ([78.60.172.133]) by mx.google.com with ESMTPS id b9sm8523899mug.54.2009.05.01.07.22.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 01 May 2009 07:22:14 -0700 (PDT) From: Grazvydas Ignotas To: linux-omap@vger.kernel.org Cc: Grazvydas Ignotas , David Brownell Subject: [PATCH] mmc-twl4030: use correct controller in twl_mmc23_set_power Date: Fri, 1 May 2009 17:22:09 +0300 Message-Id: <1241187729-11212-1-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 1.5.6.3 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org twl_mmc23_set_power() has MMC2 twl_mmc_controller hardcoded in it, which breaks MMC3. Find the right controller to use instead. Signed-off-by: Grazvydas Ignotas Cc: David Brownell --- arch/arm/mach-omap2/mmc-twl4030.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index 46d6e9b..9928e72 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c @@ -263,8 +263,19 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd) { int ret = 0; - struct twl_mmc_controller *c = &hsmmc[1]; + struct twl_mmc_controller *c = NULL; struct omap_mmc_platform_data *mmc = dev->platform_data; + int i; + + for (i = 1; i < ARRAY_SIZE(hsmmc); i++) { + if (mmc == hsmmc[i].mmc) { + c = &hsmmc[i]; + break; + } + } + + if (c == NULL) + return -ENODEV; /* If we don't see a Vcc regulator, assume it's a fixed * voltage always-on regulator.