RE: [PATCH v2 3/3] soc: aspeed: lpc-pcc: Add PCC controller support
From: Kevin Chen
Date: Mon Mar 10 2025 - 20:18:01 EST
> >> On 04/03/2025 11:44, Kevin Chen wrote:
> >>> +
> >>> +static int aspeed_pcc_probe(struct platform_device *pdev) {
> >>> + int rc;
> >>> + struct aspeed_pcc_ctrl *pcc;
> >>> + struct device *dev;
> >>> + uint32_t fifo_size = PAGE_SIZE;
> >>> +
> >>> + dev = &pdev->dev;
> >>
> >> This goes to declaration.
> > OK. I will move it to declaration.
> >
> >>
> >>> +
> >>> + pcc = devm_kzalloc(&pdev->dev, sizeof(*pcc), GFP_KERNEL);
> >>
> >> Maybe my previous comment was not clear, but you agreed with it.
> >> Anyway nothing improved here.
> > Could I reserve the pcc variable using for the pcc_ctrl data structure?
> > Pcc_ctrl data include the regmap/irq/io_port/dma/kfifo.
> > If I change the name to dev, it does not make sense for these data to be.
> >
> >>
> >> If you have 'dev' variable, use it.
> > Do you mean just use the pdev->dev not local dev variable?
> What is the point of this:
> dev = &pdev->dev;
>
> if you do not use 'dev'? If you come with a reason, sure. If you do not have such,
> then everything should use 'dev', not pdev->dev.
Agree, I fixed it in my v3 patch, and I already submitted.
Thanks for your detailed explanation.
Sorry for my misunderstanding.
>
> Best regards,
> Krzysztof