From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10BEFC433EF for ; Wed, 22 Jun 2022 08:59:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1BB8583F53; Wed, 22 Jun 2022 10:59:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="Pzqt6OcK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1952683F53; Wed, 22 Jun 2022 10:59:37 +0200 (CEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9635C83E8E for ; Wed, 22 Jun 2022 10:59:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kory.maincent@bootlin.com Received: (Authenticated sender: kory.maincent@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 95BDF20008; Wed, 22 Jun 2022 08:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1655888374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=soc1Bbn5ywgBj/NUtUktA1t1Oa0jtOZHtgXsfiFKrJ4=; b=Pzqt6OcK4OCySw3s77MuyUo9S/PJz+M+t+0q7r2HqypfBNV8drjUuBHADkPrGQfFDMxBwi GAtbl9SeI/AY6XOP9UDMSuAsFvWodx74Ltb5LrVLaHiBlLkFIwQOFsFlvNpUxMpTjzHy3l cKWWrfbBoAVu++MSKtSxitJVmN3G8QKT/HxqXRGVhALH5nOu6D+DLw8UZSkM7EXEtbQlSy rBikIyG48oqDvGuMx+xghqZyIjKaEbG6MOa5yYZSJzwLHWO8lJOv4Ze+IMN20yYcLozMIH yg8JpEmehJL3c9IDRvUKXXgGLUddQcWLy9iYkjL1HaiIpyOOQ/ojEDH1d70GVQ== From: kory.maincent@bootlin.com To: u-boot@lists.denx.de Cc: marex@denx.de, thomas.petazzoni@bootlin.com, Kory Maincent Subject: [PATCH] usb: kbd: allow probing even if usbkbd not in stdin Date: Wed, 22 Jun 2022 10:59:31 +0200 Message-Id: <20220622085931.1205590-1-kory.maincent@bootlin.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean From: Kory Maincent For now the driver does not probe if usbkbd was not present in stdin. This presents two issues, we can not probe the driver before setting stdin and we can not use this driver in other manner than stdin console. This patch fixes this by adding an else statement. It simply probes the driver without console management in the case "usbkbd" is not in stdin. Signed-off-by: Kory Maincent --- common/usb_kbd.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 352d86fb2e..d385bea532 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -581,21 +581,22 @@ static int probe_usb_keyboard(struct usb_device *dev) stdinname = env_get("stdin"); #if CONFIG_IS_ENABLED(CONSOLE_MUX) - error = iomux_doenv(stdin, stdinname); - if (error) - return error; + if (strstr(stdinname, DEVNAME) != NULL) { + error = iomux_doenv(stdin, stdinname); + if (error) + return error; + } #else /* Check if this is the standard input device. */ - if (strcmp(stdinname, DEVNAME)) - return 1; - - /* Reassign the console */ - if (overwrite_console()) - return 1; + if (!strcmp(stdinname, DEVNAME)) { + /* Reassign the console */ + if (overwrite_console()) + return 1; - error = console_assign(stdin, DEVNAME); - if (error) - return error; + error = console_assign(stdin, DEVNAME); + if (error) + return error; + } #endif return 0; -- 2.25.1