[PATCH v5 2/5] dma-engine: sun4i: Add has_reset option to quirk

Csókás Bence csokas.bence at prolan.hu
Sun Nov 3 23:41:56 PST 2024


Hi!

On 2024. 11. 02. 18:45, Andre Przywara wrote:
> On Sat, 2 Nov 2024 10:31:41 +0100
> "Csókás, Bence" <csokas.bence at prolan.hu> wrote:
> 
> Hi,
> 
>> From: Mesih Kilinc <mesihkilinc at gmail.com>
>>
>>   static struct sun4i_dma_dev *to_sun4i_dma_dev(struct dma_device *dev)
>> @@ -1215,6 +1218,13 @@ static int sun4i_dma_probe(struct platform_device *pdev)
>>   		return PTR_ERR(priv->clk);
>>   	}
>>   
>> +	if (priv->cfg->has_reset) {
>> +		priv->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
> 
> Can't we use devm_reset_control_get_optional_exclusive(), and then save
> this whole has_reset bit?

For suniv, reset is REQUIRED. For sun4i, reset DOES NOT EXIST.

has_reset does not mean that whether this instance has a reset control 
or not, that is handled by checking priv->rst for NULL. has_reset means 
whether reset is REQUIRED by this type of DMA, specified by the DT match 
data.

Bence




More information about the linux-arm-kernel mailing list