From patchwork Fri Apr 20 14:52:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 133879 Delivered-To: patches@linaro.org Received: by 10.46.66.142 with SMTP id h14csp374874ljf; Fri, 20 Apr 2018 07:52:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx49HLLbHZKI8QFsyZGa5qtVzFYwzSIUmHIrqrOzT+2JqLls3eodigKlls+UE53lBXuyrs3Zy X-Received: by 2002:adf:afe4:: with SMTP id y36-v6mr8547272wrd.107.1524235972354; Fri, 20 Apr 2018 07:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524235972; cv=none; d=google.com; s=arc-20160816; b=ecociFdmbfMtnmKm9vdhL9t2zrT7u5AnmJgQZP5GvQo0JE/XZVDTZQEfeeT91JYcqr Igzjh5/LkrS6Kji+PzU9vFFjGaW9tvpXh7gLMIYoPlN/FHRiAAMJ11/RXpfMNYf4zQPu X2J/Sznrbe0UPYZxmcGXdjH2jxB4FMVBbgWWAU95twi3e5PMuhAc7H9XHOE/yhgYyTaD wdQcqCQ0P+trNAFlXMtQADJmRvEFNIOrj/sk87xNlu22Ud30Ge5/iZAt1zGXoZj0c8is bhMbc0u/1p07X+DxcQxSYrnFH03AI7+7Cprxzl56HDoxZ8Z4gqXwyGhyPSM+c4Npb98h OaLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=vib07ld9Y/c8nmzzwNlIbDJbw1IlASvZ1uk8diO0Mmk=; b=CmlOhEzlMj5vgZmgjshXzqqQhpOFqxxULW8Us+LDJSTUGH3Z0ZyU3bXcPIcRK2EcV5 +btvUHXAyYidvW++jpSBaR1y3k/qGkMWEWbfrPLbMyJVFhSJU61CPESGHA5bdA/gs7q/ hy/R/cHMS4fJBfiAHE0/JLL/U3FGFsLayLhKrP8WjWCM/IRRCL4NzYQVkqpeYrxZ++js PW82aSs/RLKndlu5svgB87OvJy4xKOshiHK1uX3JB75QKHunS2gn3d1F7LtWfDjvrVtR pWI2Faj6Y2dcr7n9FMa0TVICtrYsR8yHw7ZhekAwYdyNyAPWWJwsiqrFJeA4yHXnnuP7 2iEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id y63si1210197wmb.109.2018.04.20.07.52.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Apr 2018 07:52:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1f9XP9-0006XC-HZ; Fri, 20 Apr 2018 15:52:51 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, "Michael S . Tsirkin" , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [PATCH 02/13] hw/arm/fsl-imx*: Don't create "null" chardevs for serial devices Date: Fri, 20 Apr 2018 15:52:38 +0100 Message-Id: <20180420145249.32435-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180420145249.32435-1-peter.maydell@linaro.org> References: <20180420145249.32435-1-peter.maydell@linaro.org> Following commit 12051d82f004024, UART devices should handle being passed a NULL pointer chardev, so we don't need to create "null" backends in board code. Remove the code that does this and updates serial_hds[]. (fsl-imx7.c was already written this way.) Signed-off-by: Peter Maydell --- hw/arm/fsl-imx25.c | 12 +----------- hw/arm/fsl-imx31.c | 12 +----------- hw/arm/fsl-imx6.c | 13 +------------ 3 files changed, 3 insertions(+), 34 deletions(-) -- 2.17.0 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c index cb988a6c25..d7d064e5ce 100644 --- a/hw/arm/fsl-imx25.c +++ b/hw/arm/fsl-imx25.c @@ -118,17 +118,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) }; if (i < MAX_SERIAL_PORTS) { - Chardev *chr; - - chr = serial_hds[i]; - - if (!chr) { - char label[20]; - snprintf(label, sizeof(label), "imx31.uart%d", i); - chr = qemu_chr_new(label, "null"); - } - - qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", chr); + qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hds[i]); } object_property_set_bool(OBJECT(&s->uart[i]), true, "realized", &err); diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c index 3eee83d547..e6c788049d 100644 --- a/hw/arm/fsl-imx31.c +++ b/hw/arm/fsl-imx31.c @@ -107,17 +107,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp) }; if (i < MAX_SERIAL_PORTS) { - Chardev *chr; - - chr = serial_hds[i]; - - if (!chr) { - char label[20]; - snprintf(label, sizeof(label), "imx31.uart%d", i); - chr = qemu_chr_new(label, "null"); - } - - qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", chr); + qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hds[i]); } object_property_set_bool(OBJECT(&s->uart[i]), true, "realized", &err); diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index 9dfbc9a8c4..ea14de33c6 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -189,18 +189,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) }; if (i < MAX_SERIAL_PORTS) { - Chardev *chr; - - chr = serial_hds[i]; - - if (!chr) { - char *label = g_strdup_printf("imx6.uart%d", i + 1); - chr = qemu_chr_new(label, "null"); - g_free(label); - serial_hds[i] = chr; - } - - qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", chr); + qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hds[i]); } object_property_set_bool(OBJECT(&s->uart[i]), true, "realized", &err);