From patchwork Fri May 31 12:55:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 2643861 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 39D1740232 for ; Fri, 31 May 2013 12:56:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753819Ab3EaM4K (ORCPT ); Fri, 31 May 2013 08:56:10 -0400 Received: from mail-we0-f180.google.com ([74.125.82.180]:49888 "EHLO mail-we0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207Ab3EaMzy (ORCPT ); Fri, 31 May 2013 08:55:54 -0400 Received: by mail-we0-f180.google.com with SMTP id t60so1220913wes.11 for ; Fri, 31 May 2013 05:55:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references:content-type:x-gm-message-state; bh=ctP5z28BVc1doNLHbhDG86EEN1yvKlDWoYkEstwZ0UI=; b=BH4go1aMc8miVOv28lw9SVPBomTGYWwO5FFJ3Svy3blfjnm50qeZb0YAB62hRAFb/D /MSf+lXRgt1bnYvq2XRAr4QguoHyaOvGVJ3na/BtMrJa9KQBdxgx4QZuBPzJCGACFIlF oipV3j56ioQKg0q/c1JVdaUaR4jy8zVQcAI72wMXjjcKpNqkSKzd+GZH/CL0wakZEDX8 4MTrtH3NzXIKfBQWpTczARrCLtlHPLd9xt/KjlUuMPsQ02e11YPv1Vr/+7SCuDd1/mpd SDnNaiRjIkUP3ATH0i1FTIuixMwVAOO+vXwcBFjUhibwLzUEWIwPwmhrjSNpLMmWNwAV FbZg== X-Received: by 10.180.198.80 with SMTP id ja16mr3089758wic.53.1370004952628; Fri, 31 May 2013 05:55:52 -0700 (PDT) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id w8sm4823588wiz.0.2013.05.31.05.55.50 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Fri, 31 May 2013 05:55:51 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org Cc: Michal Simek , Michal Simek , Arnd Bergmann , Timur Tabi , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Grant Likely , Rob Herring , linux-fbdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Subject: [PATCH v3 1/8] video: xilinxfb: Fix OF probing on little-endian systems Date: Fri, 31 May 2013 14:55:31 +0200 Message-Id: <0a546c3de84c4650d019274debef0ded9007b36f.1370004925.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQnqdd0KwRHjHsopfqJcpYvnyw0CCM2DDv1cDjxVJMcwLFOGvRj0ffi6k21NmFfT5MYmvlNY Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Michal Simek DTB is always big-endian that's why it is necessary to properly convert value (*p). It is automatically done in of_property_read_u32(). Signed-off-by: Michal Simek --- Changes in v3: None Changes in v2: - use of_property_read_u32 helper function Series-changes: 3 - fix commit message drivers/video/xilinxfb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 1.8.2.3 diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c index af0b4fd..aecd15d 100644 --- a/drivers/video/xilinxfb.c +++ b/drivers/video/xilinxfb.c @@ -406,8 +406,7 @@ static int xilinxfb_release(struct device *dev) static int xilinxfb_of_probe(struct platform_device *op) { const u32 *prop; - u32 *p; - u32 tft_access; + u32 tft_access = 0; struct xilinxfb_platform_data pdata; struct resource res; int size, rc; @@ -427,8 +426,8 @@ static int xilinxfb_of_probe(struct platform_device *op) * To check whether the core is connected directly to DCR or PLB * interface and initialize the tft_access accordingly. */ - p = (u32 *)of_get_property(op->dev.of_node, "xlnx,dcr-splb-slave-if", NULL); - tft_access = p ? *p : 0; + of_property_read_u32(op->dev.of_node, "xlnx,dcr-splb-slave-if", + &tft_access); /* * Fill the resource structure if its direct PLB interface