Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757350Ab1BRIPt (ORCPT ); Fri, 18 Feb 2011 03:15:49 -0500 Received: from symlink.to.noone.org ([85.10.207.172]:53270 "EHLO sym.noone.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756241Ab1BRIPr (ORCPT ); Fri, 18 Feb 2011 03:15:47 -0500 Date: Fri, 18 Feb 2011 09:15:46 +0100 From: Tobias Klauser To: Grant Likely Cc: Thomas Chou , nios2-dev@sopc.et.ntust.edu.tw, Greg Kroah-Hartman , linux-serial@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [Nios2-dev] [PATHV v2] tty: serial: altera_uart: Add devicetree support Message-ID: <20110218081546.GC759@distanz.ch> References: <1297872732-10207-1-git-send-email-tklauser@distanz.ch> <4D5C86C1.8070404@wytron.com.tw> <20110217074846.GG4076@distanz.ch> <4D5DCB46.9090506@wytron.com.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Editor: Vi IMproved 7.1 User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1674 Lines: 41 On 2011-02-18 at 09:08:53 +0100, Grant Likely wrote: > On Thu, Feb 17, 2011 at 6:28 PM, Thomas Chou wrote: > > On 02/17/2011 03:48 PM, Tobias Klauser wrote: > >>>> > >>>> + ret = altera_uart_get_of_uartclk(pdev, port); > >>>> + if (ret&& platp) > >>>> + port->uartclk = platp->uartclk; > >>>> + else if (ret) > >>>> + return ret; > >>>> + > >>> > >>> Better reverse the priority, with platform data checked first. > >>> > >>> if (platp) > >>> port->uartclk = platp->uartclk; > >>> else { > >>> ret = altera_uart_get_of_uartclk(pdev, port); > >>> if (ret) > >>> return ret; > >>> } > >> > >> Do you have a specific reasoning for this? I thought it might make sense > >> to do it in the same order as with the resources above, but I have no > >> problem changing it to the way you suggest. > > > > Not quite sure. But I see some drivers follow this order, and I just > > followed, too. > > The reason to check for platform_data first is that if a device has > *both* platform data and a device node pointer, then more than likely > the platform_data is indented to override the device node data. Thanks Grant and Thomas for the explanation. I was just wondering. I'll send an updated patch including the changes suggested by Thomas. Tobias -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/