[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices
From: |
Peter Maydell |
Subject: |
Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices |
Date: |
Mon, 16 May 2022 15:56:58 +0100 |
On Fri, 13 May 2022 at 22:09, Peter Delevoryas <pdel@fb.com> wrote
> I was actually intentionally skipping that. If serial_hd(i)
> doesn’t exist, the function will return NULL.
>
> Chardev *serial_hd(int i)
> {
> assert(i >= 0);
> if (i < num_serial_hds) {
> return serial_hds[i];
> }
> return NULL;
> }
>
> So then, the serial device’s CharBackend’s “Chardev *chr”
> will be initialized as NULL. Looking at all of the
> usage of this attribute in “hw/char/serial.c”, I think
> that’s ok, the read/write functions will just be no-ops.
> They all have guards for “chr == NULL”.
Yes, this is deliberate. We added these in commit 12051d82f0040
because otherwise lots of board/SoC code would have to create
NullChardev dummy backends (or forget to and then crash depending
on the user's commandline).
thanks
-- PMM
- [PATCH 0/2] hw: aspeed: Init all UART's with serial devices, Peter Delevoryas, 2022/05/13
- [PATCH 2/2] hw: aspeed: Init all UART's with serial devices, Peter Delevoryas, 2022/05/13
- Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices, Cédric Le Goater, 2022/05/13
- Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices, Peter Delevoryas, 2022/05/13
- Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices, Cédric Le Goater, 2022/05/14
- Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices, Peter Delevoryas, 2022/05/14
- Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices, Cédric Le Goater, 2022/05/15
- Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices, Peter Delevoryas, 2022/05/15
- Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices,
Peter Maydell <=
[PATCH 1/2] hw: aspeed: Add missing UART's, Peter Delevoryas, 2022/05/13
Re: [PATCH 0/2] hw: aspeed: Init all UART's with serial devices, Zev Weiss, 2022/05/13