[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <afa5dacd-83ef-a608-46c7-1fb0f3e370b8@silicom.dk>
Date: Wed, 14 Jul 2021 16:27:02 +0200
From: Martin Hundebøll <mhu@...icom.dk>
To: Tom Rix <trix@...hat.com>,
Martin Hundebøll <martin@...nix.com>,
Wu Hao <hao.wu@...el.com>, Moritz Fischer <mdf@...nel.org>,
Xu Yilun <yilun.xu@...el.com>,
Jean Delvare <jdelvare@...e.com>,
Guenter Roeck <linux@...ck-us.net>,
Lee Jones <lee.jones@...aro.org>,
Mark Brown <broonie@...nel.org>
Cc: linux-fpga@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hwmon@...r.kernel.org, linux-spi@...r.kernel.org
Subject: Re: [PATCH v4 2/4] spi: spi-altera-dfl: support n5010 feature
revision
On 14/07/2021 16.22, Tom Rix wrote:
>
> On 7/14/21 4:33 AM, Martin Hundebøll wrote:
>>
>>
>> On 06/07/2021 16.56, Tom Rix wrote:
>>>> diff --git a/drivers/spi/spi-altera-dfl.c b/drivers/spi/spi-altera-dfl.c
>>>> index 3e32e4fe5895..f6cf7c8d9dac 100644
>>>> --- a/drivers/spi/spi-altera-dfl.c
>>>> +++ b/drivers/spi/spi-altera-dfl.c
>>>> @@ -111,6 +111,13 @@ static struct spi_board_info m10_bmc_info = {
>>>> .chip_select = 0,
>>>> };
>>>> +static struct spi_board_info m10_n5010_bmc_info = {
>>>> + .modalias = "m10-n5010",
>>>> + .max_speed_hz = 12500000,
>>>> + .bus_num = 0,
>>>> + .chip_select = 0,
>>>> +};
>>>
>>> Other then the modalias, this is exactly the same as m10_bmc_info.
>>>
>>> Why not set platform_data?
>>
>> So like this?
>>
>> +static struct spi_board_info m10_n5010_bmc_info = {
>> + .platform_data = "m10-n5010",
>> + .max_speed_hz = 12500000,
>> + .bus_num = 0,
>> + .chip_select = 0,
>> +};
>>
>> I don't see how that should improve the situation, but we might allocate
>> the board info on the stack and set modalias dynamically instead?
>
> No, I mean that instead of have two *bmc_info's generalize the existing one.
>
> This could be done by using the as yet unused platform_data field to hold the identity as a bit/enum in an int.
But the existing one is global/static, so it would need
to be moved to the function/stack, yes?
In which case we could as easily keep the existing approach
of modalias, and avoid changing both drivers/fpga/dfl-n3000-nios.c
and drivers/mfd/intel-m10-bmc.c ...
// Martin
Powered by blists - more mailing lists