linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurentiu Palcu <laurentiu.palcu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Johan Havold <johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Octavian Purdila
	<octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/2] spi: add support for DLN-2 USB-SPI adapter
Date: Tue, 11 Nov 2014 14:38:08 +0200	[thread overview]
Message-ID: <20141111123808.GM5826@lpalcu-linux> (raw)
In-Reply-To: <20141108104606.GH2722-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

Hi Mark,

On Sat, Nov 08, 2014 at 10:46:06AM +0000, Mark Brown wrote:
> On Fri, Nov 07, 2014 at 02:45:13PM +0200, Laurentiu Palcu wrote:
> 
> > +static int dln2_spi_transfer_one_message(struct spi_master *master,
> > +					 struct spi_message *msg)
> 
> It's a bit sad not to do transfer_one() but it's reasonable not to
> because of the fun way /CS is being set.
My first attempts were with transfer_one()/set_cs() until I realized,
using an oscilloscope, that DLN2 automatically toggles the /CS during
read/write operations and that DLN2_SPI_SET_SS only instructs device
which CS pins to toggle... :/

> 
> > +	ret = dln2_spi_get_speed_range(dln2,
> > +					   &master->min_speed_hz,
> > +					   &master->max_speed_hz);
> 
> Strange indentation here.
I did some last minute function renaming and forgot to re-indent. Will
fix in v2.
> 
> > +static int dln2_spi_remove(struct platform_device *pdev)
> > +{
> > +	struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
> > +	struct dln2_spi *dln2 = spi_master_get_devdata(master);
> > +
> > +	if (dln2_spi_enable(dln2, false) < 0)
> > +		dev_err(&pdev->dev, "Failed to disable SPI module\n");
> > +
> > +	spi_master_put(master);
> 
> You shouldn't need this _put(), it's defeating the purpose of having the
> devm_ registration.
Agreed! I used spi-rockchip.c as a template and I took it for granted.
I'll remove this line in v2. And, if you think it's worth it, I can send
a separate patch for spi-rockchip.c too.

thanks,
laurentiu



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-11-11 12:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 12:45 [PATCH 0/2] Add SPI support for Diolan DLN2 Laurentiu Palcu
2014-11-07 12:45 ` [PATCH 1/2] spi: add support for DLN-2 USB-SPI adapter Laurentiu Palcu
     [not found]   ` <1415364314-30320-2-git-send-email-laurentiu.palcu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-08 10:46     ` Mark Brown
     [not found]       ` <20141108104606.GH2722-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-11-11 12:38         ` Laurentiu Palcu [this message]
2014-11-11 12:41           ` Mark Brown
2014-11-07 12:45 ` [PATCH 2/2] mfd: dln2: add support for USB-SPI module Laurentiu Palcu
     [not found]   ` <1415364314-30320-3-git-send-email-laurentiu.palcu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-08 10:33     ` Mark Brown
2014-11-10  9:30     ` Lee Jones
2014-11-11 13:09       ` Laurentiu Palcu
2014-11-13 10:32         ` Lee Jones

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=20141111123808.GM5826@lpalcu-linux \
    --to=laurentiu.palcu-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.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).