RE: [PATCH v3 3/3] soc: aspeed: lpc-pcc: Add PCC controller support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 10/03/2025 12:48, Kevin Chen wrote:
> > +static int aspeed_pcc_probe(struct platform_device *pdev) {
> > +	int rc;
> > +	struct aspeed_pcc_ctrl *pcc;
> > +	struct device *dev = &pdev->dev;
> > +	uint32_t fifo_size = PAGE_SIZE;
> > +
> > +	pcc = devm_kzalloc(dev, sizeof(*pcc), GFP_KERNEL);
> > +	if (!pcc)
> > +		return -ENOMEM;
> > +
> > +	pcc->regmap = syscon_node_to_regmap(dev->parent->of_node);
> > +	if (IS_ERR(pcc->regmap)) {
> > +		dev_err(dev, "Couldn't get regmap\n");
> 
> return dev_err_probe() is not suitable?
Agree. Change to " dev_err_probe(dev, PTR_ERR(pcc->regmap),"Couldn't get regmap\n");"?

> 
> > +		return -ENODEV;
> 
> Why overriding error code?

> 
> > +	}
> > +
> > +	rc = of_property_read_u32(dev->of_node, "pcc-ports", &pcc->port);
> > +	if (rc) {
> > +		dev_err(dev, "no pcc ports configured\n");
> > +		return -ENODEV;
> 
> Why overriding error code?
Agree.

> 
> You got this comment already at v2.
Sorry, I already checked the comment in v2.

> 
> > +	}
> > +
> > +	rc = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
> > +	if (rc) {
> > +		dev_err(dev, "cannot set 64-bits DMA mask\n");
> > +		return rc;
> > +	}
> > +
> > +	pcc->dma.size = PCC_DMA_BUFSZ;
> > +	pcc->dma.virt = dmam_alloc_coherent(dev,
> > +					    pcc->dma.size,
> > +					    &pcc->dma.addr,
> > +					    GFP_KERNEL);
> > +	if (!pcc->dma.virt) {
> > +		dev_err(dev, "cannot allocate DMA buffer\n");
> > +		return -ENOMEM;
> > +	}
> > +
> > +	fifo_size = roundup(pcc->dma.size, PAGE_SIZE);
> > +	rc = kfifo_alloc(&pcc->fifo, fifo_size, GFP_KERNEL);
> > +	if (rc) {
> 
> Drop {}
Agree.
> 
> > +		return -ENOMEM;
> > +	}
> > +
> 
> Please run scripts/checkpatch.pl and fix reported warnings. After that, run also
> `scripts/checkpatch.pl --strict` and (probably) fix more warnings. Some
> warnings can be ignored, especially from --strict run, but the code here looks
> like it needs a fix. Feel free to get in touch if the warning is not clear.
Agree.

> 
> 
> 
> Best regards,
> Krzysztof




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux