From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752360AbdBJPXy (ORCPT ); Fri, 10 Feb 2017 10:23:54 -0500 Received: from 8bytes.org ([81.169.241.247]:56864 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433AbdBJPXw (ORCPT ); Fri, 10 Feb 2017 10:23:52 -0500 Date: Fri, 10 Feb 2017 16:22:54 +0100 From: Joerg Roedel To: Robin Murphy Cc: Will Deacon , Lorenzo Pieralisi , Alex Williamson , David Woodhouse , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface Message-ID: <20170210152254.GI7339@8bytes.org> References: <1486639981-32368-1-git-send-email-joro@8bytes.org> <1486639981-32368-7-git-send-email-joro@8bytes.org> <417eee8c-4e1b-57f0-2c00-d6c3926ce66d@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <417eee8c-4e1b-57f0-2c00-d6c3926ce66d@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robin, On Fri, Feb 10, 2017 at 02:16:54PM +0000, Robin Murphy wrote: > > +static inline void iommu_device_set_fwnode(struct iommu_device *iommu, > > + struct fwnode_handle *fwnode) > > +{ > > + iommu->fwnode = fwnode; > > +} > > Would it make sense to simply make the ops and fwnode additional > arguments to iommu_device_register() (permitting fwnode to be NULL)? > AFAICS they should typically all have the same effective lifetime so > there doesn't seem to be any real need to handle everything separately. Well, it is not yet clear what other information will end up in 'struct iommu_device', and I don't want to add another parameter to iommu_device_register for every new struct member. Also I think having these wrappers is more readable in the code, as it is clear what the code does without looking up the function prototypes in the header. It might make sense to set the mandatory struct members via iommu_device_register in the future, but we'll see :) Joerg