From patchwork Mon Jun 3 10:13:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 2651691 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 4861C3FC23 for ; Mon, 3 Jun 2013 10:13:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756463Ab3FCKNf (ORCPT ); Mon, 3 Jun 2013 06:13:35 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:55954 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753604Ab3FCKNa (ORCPT ); Mon, 3 Jun 2013 06:13:30 -0400 Received: by mail-wg0-f53.google.com with SMTP id m15so2991622wgh.8 for ; Mon, 03 Jun 2013 03:13:29 -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=EsFl0szTkESvXhZylKQ0KZcCR47A6C3baC2nC4r8hHE=; b=ntBs2nJQfg1HllYYgeDBI8LjMs7Qlusq5wqjRcHEp/cWu5+6fOoJhpP4n2xxopAkVt aQfKqwuPToJm+NDGA3hQaMHxKgr9gmvtP5ZMDAjt9pybeODuozNMavJGeaZa75hTrIv3 odxpixV5CUglfhWUvSTZtVa0hMPAH+7Z6Qu5pgkVfD8ZcbfGM4lNWxhTzg5Pdx7yZFHH xhmBBWAy7ITWaKhJ+S7qvUK7OMoF6Mt1nITA9aq/kglffMYwwwZ4PswQxc8RSF0C2cWW MRwQDxm9BNbtv5Rs5XZRqW9FEFEHjBoq7bI7X15U3tJMm2oyPpTpura8M2EAtVtg4zjo zaOQ== X-Received: by 10.180.36.205 with SMTP id s13mr11709509wij.31.1370254409667; Mon, 03 Jun 2013 03:13:29 -0700 (PDT) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id ca19sm22345931wib.3.2013.06.03.03.13.26 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 03 Jun 2013 03:13:28 -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 v4 1/7] video: xilinxfb: Fix OF probing on little-endian systems Date: Mon, 3 Jun 2013 12:13:16 +0200 Message-Id: <262ff72a86eda8d0dfadd11783340a77d04e9b67.1370254386.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: ALoCoQnIRLCTuiStak3LZQ1eU58A6BT1yC/OoQOsxBPX3lcPx0DKeQ48tNBZaUVMPxcotB5E9T9o 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 v4: None Changes in v3: - fix commit message Changes in v2: - use of_property_read_u32 helper function 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