From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X06EC-0003Gl-Mg for barebox@lists.infradead.org; Thu, 26 Jun 2014 09:44:25 +0000 Received: by mail-we0-f178.google.com with SMTP id x48so3270497wes.9 for ; Thu, 26 Jun 2014 02:44:01 -0700 (PDT) Date: Thu, 26 Jun 2014 11:43:56 +0200 From: Alexander Aring Message-ID: <20140626094355.GA10359@omega> References: <1403772557-28482-3-git-send-email-holgerschurig@gmail.com> <20140626093701.GA9619@omega> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140626093701.GA9619@omega> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 2/4] sandbox: only access of_add_memory_bank if it's defined To: Holger Schurig Cc: barebox@lists.infradead.org On Thu, Jun 26, 2014 at 11:37:01AM +0200, Alexander Aring wrote: > Hi Holger, > > can you please check if this is also a solution for this? > > diff --git a/include/of.h b/include/of.h > index e6993fd..76845e7 100644 > --- a/include/of.h > +++ b/include/of.h > @@ -227,7 +227,14 @@ int of_parse_partitions(struct cdev *cdev, struct device_node *node); > int of_device_is_stdout_path(struct device_d *dev); > const char *of_get_model(void); > void *of_flatten_dtb(struct device_node *node); > +#ifdef CONFIG_OFTREE_MEM_GENERIC > int of_add_memory(struct device_node *node, bool dump); > +#else > +static inline int of_add_memory(struct device_node *node, bool dump) > +{ > + return -EINVAL; > +} > +#endif > void of_add_memory_bank(struct device_node *node, bool dump, int r, > u64 base, u64 size); > struct device_d *of_find_device_by_node_path(const char *path); > > > Okay the implementation "#ifdef CONFIG_OFTREE_MEM_GENERIC" for function of_add_memory, need to be there. Other option would be to put this function in a separete file which depends on CONFIG_OFTREE_MEM_GENERIC and do in the header file the above solution one. Don't know if this is better. Then you could drop the #ifdef CONFIG_OFTREE_MEM_GENERIC from the implementation. - Alex _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox