From patchwork Wed Mar 13 08:47:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 2262311 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C33EF3FCF6 for ; Wed, 13 Mar 2013 08:48:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755418Ab3CMIrZ (ORCPT ); Wed, 13 Mar 2013 04:47:25 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:46122 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755032Ab3CMIrX (ORCPT ); Wed, 13 Mar 2013 04:47:23 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r2D8lJ8x013728; Wed, 13 Mar 2013 03:47:20 -0500 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2D8lHJP014114; Wed, 13 Mar 2013 14:17:19 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Wed, 13 Mar 2013 14:17:17 +0530 Received: from a0393678lt.apr.dhcp.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2D8lDCE022407; Wed, 13 Mar 2013 14:17:17 +0530 From: Kishon Vijay Abraham I To: , , , , CC: , , Kishon Vijay Abraham I Subject: [PATCH 2/5] usb: musb: omap: always glue have the correct vbus/id status Date: Wed, 13 Mar 2013 14:17:07 +0530 Message-ID: <1363164430-19118-3-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363164430-19118-1-git-send-email-kishon@ti.com> References: <1363164430-19118-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org In the case where omap glue is loaded and musb core is not, glue->status wont have a valid status if the phy drivers call omap_musb_mailbox. So fixed the conditions here. Signed-off-by: Kishon Vijay Abraham I --- drivers/usb/musb/omap2430.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 78bfc50..28a0220 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -236,13 +236,10 @@ void omap_musb_mailbox(enum omap_musb_vbus_id_status status) { struct omap2430_glue *glue = _glue; - if (glue && glue_to_musb(glue)) { - glue->status = status; - } else { - pr_err("%s: musb core is not yet ready\n", __func__); + if (!glue) return; - } + glue->status = status; schedule_work(&glue->omap_musb_mailbox_work); } EXPORT_SYMBOL_GPL(omap_musb_mailbox); @@ -307,7 +304,9 @@ static void omap_musb_mailbox_work(struct work_struct *mailbox_work) { struct omap2430_glue *glue = container_of(mailbox_work, struct omap2430_glue, omap_musb_mailbox_work); - omap_musb_set_mailbox(glue); + + if (glue_to_musb(glue)) + omap_musb_set_mailbox(glue); } static irqreturn_t omap2430_musb_interrupt(int irq, void *__hci)