linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: Alan Tull <atull@kernel.org>
Cc: Moritz Fischer <mdf@kernel.org>, linux-fpga@vger.kernel.org
Subject: Re: [PATCH v2] fpga: mgr: altera-ps-spi: enable usage on non-dt platforms
Date: Mon, 5 Nov 2018 18:54:13 +0100	[thread overview]
Message-ID: <20181105185413.6ee0ba0d@crub> (raw)
In-Reply-To: <CANk1AXQCQpi7nuvDSPGrp=zwvkhKpWha6_5T=7hYaZFpjsyuxw@mail.gmail.com>

Hi Alan,

On Thu, 1 Nov 2018 14:37:02 -0500
Alan Tull atull@kernel.org wrote:
...
>>  static const struct spi_device_id altera_ps_spi_ids[] = {
>> -       {"cyclone-ps-spi", 0},
>> +       {"cyclone-ps-spi", (kernel_ulong_t)&c5_data},
>> +       {"fpga-passive-serial", (kernel_ulong_t)&c5_data},
>> +       {"fpga-arria10-passive-serial", (kernel_ulong_t)&a10_data},  
>
>I don't think this should be implemented as a pointer. This would be
>easy if driver_data were void* but it's a value that's not a pointer.
> I suggest using driver_data as a index to an array of pointers to the
>structs instead.

Thanks for review. I've sent v3 using array of pointers. It uses
the FPGA type in driver_data. It could be used as an index to the
array of pointers, but I'd prefer checking for this type explicitly,
so it will work even if the array is wrongly extended or reordered
by future changes.

Thanks,

Anatolij

      reply	other threads:[~2018-11-05 17:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 14:17 [PATCH v2] fpga: mgr: altera-ps-spi: enable usage on non-dt platforms Anatolij Gustschin
2018-11-01 19:37 ` Alan Tull
2018-11-05 17:54   ` Anatolij Gustschin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181105185413.6ee0ba0d@crub \
    --to=agust@denx.de \
    --cc=atull@kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=mdf@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).