lkml.org 
[lkml]   [2018]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v7 2/6] iommu/arm-smmu: Add pm_runtime/sleep ops
On Tue, Feb 13, 2018 at 7:25 PM, Vivek Gautam
<vivek.gautam@codeaurora.org> wrote:
>>> +static int arm_smmu_init_clks(struct arm_smmu_device *smmu)
>>> +{
>>> + int i;
>>> + int num = smmu->num_clks;
>>> + const struct arm_smmu_match_data *data;
>>> +
>>> + if (num < 1)
>>> + return 0;
>>> +
>>> + smmu->clocks = devm_kcalloc(smmu->dev, num,
>>> + sizeof(*smmu->clocks), GFP_KERNEL);
>>> + if (!smmu->clocks)
>>> + return -ENOMEM;
>>> +
>>> + data = of_device_get_match_data(smmu->dev);
>>> +
>>> + for (i = 0; i < num; i++)
>>> + smmu->clocks[i].id = data->clks[i];
>>
>> I'd argue that arm_smmu_device_dt_probe() is a better place for all
>> the code above, since this function is called regardless of whether
>> the device is probed from DT or not. Going further,
>> arm_smmu_device_acpi_probe() could fill smmu->num_clks and ->clocks
>> using ACPI-like way (as opposed to OF match data) if necessary.
>
> Right, it's valid to fill the data in arm_smmu_device_dt_probe().
> Perhaps we can just keep the devm_clk_bulk_get() in arm_smmu_device_probe()
> at the point where we are currently doing arm_smmu_init_clks().

Sounds good to me. Thanks.

Best regards,
Tomasz

\
 
 \ /
  Last update: 2018-02-14 04:51    [W:0.066 / U:3.792 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site