From patchwork Tue Apr 30 12:45:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 16522 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ea0-f197.google.com (mail-ea0-f197.google.com [209.85.215.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 46D2E20065 for ; Tue, 30 Apr 2013 12:46:38 +0000 (UTC) Received: by mail-ea0-f197.google.com with SMTP id d10sf647280eaj.4 for ; Tue, 30 Apr 2013 05:46:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=j3WGezRJ3K1NPS/kea7hnjwoGLJIGigEN9L7iaCGXU0=; b=iBTHw5PmeK9skiHwliX/s3PahsxfKfLnmoaGDtlbu+hPRDs4mPkcxNPcawovFi9EDX UnkRK+/N7gcU2qtJr/OHh41ALriLSnzB/q1NiwnVjzPzVXlm6D6xxQWofyz+5/tbzlZQ c0gL7k4Rd5A6T3LBTnINOlAAR6fM72tGOC6ckyjhDShnA2gbjshfP+8lD/qS4nuKOvPa 49F33R0RMBfCiAXXd452zIz9b9GiOljAAI+5o05rh7qYCWBv02wsq1HBWhLWcf6wSCzJ YU69K/aVP2f7GN6KO/1B2g4iczMlxyIemoKbqAU6hkUAnF3FKWMz5ZE5jnovJtDm2z06 wjDg== X-Received: by 10.180.85.5 with SMTP id d5mr10106942wiz.0.1367325994576; Tue, 30 Apr 2013 05:46:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.100.201 with SMTP id fa9ls502853wib.12.canary; Tue, 30 Apr 2013 05:46:34 -0700 (PDT) X-Received: by 10.180.185.135 with SMTP id fc7mr15072392wic.29.1367325994497; Tue, 30 Apr 2013 05:46:34 -0700 (PDT) Received: from mail-ve0-x234.google.com (mail-ve0-x234.google.com [2607:f8b0:400c:c01::234]) by mx.google.com with ESMTPS id n16si5606973wij.91.2013.04.30.05.46.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 05:46:34 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::234; Received: by mail-ve0-f180.google.com with SMTP id pb11so332388veb.11 for ; Tue, 30 Apr 2013 05:46:33 -0700 (PDT) X-Received: by 10.52.66.101 with SMTP id e5mr2615784vdt.57.1367325993409; Tue, 30 Apr 2013 05:46:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp104957veb; Tue, 30 Apr 2013 05:46:32 -0700 (PDT) X-Received: by 10.180.198.49 with SMTP id iz17mr24241756wic.19.1367325992142; Tue, 30 Apr 2013 05:46:32 -0700 (PDT) Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by mx.google.com with ESMTPS id g1si29408101eeo.84.2013.04.30.05.46.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 05:46:32 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.44 is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=74.125.83.44; Received: by mail-ee0-f44.google.com with SMTP id t10so231162eei.17 for ; Tue, 30 Apr 2013 05:46:31 -0700 (PDT) X-Received: by 10.14.194.70 with SMTP id l46mr87431606een.28.1367325991515; Tue, 30 Apr 2013 05:46:31 -0700 (PDT) Received: from localhost ([2a01:2003:1:1f50:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPSA id f9sm38529309eeu.11.2013.04.30.05.46.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Apr 2013 05:46:30 -0700 (PDT) From: Fabio Baltieri To: Mike Turquette , Ulf Hansson Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij , Lee Jones , Fabio Baltieri Subject: [PATCH] clk: ux500: clk-sysctrl: handle clocks with no parents Date: Tue, 30 Apr 2013 14:45:06 +0200 Message-Id: <1367325906-23045-1-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.8.2 X-Gm-Message-State: ALoCoQnHfagC2c4NVBf4JUzlx/jgIHXZ9wIHo68E33OZ6POw+A1Tg3feHPfzc3TDXvB9Ie7aY7P7 X-Original-Sender: fabio.baltieri@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Fix clk_reg_sysctrl() to set main clock registers of new struct clk_sysctrl even if the registered clock has no parents. This fixes an issue where "ulpclk" was registered with all clk->reg_* fields uninitialized, causing a -EINVAL error from clk_prepare(). Cc: Ulf Hansson Signed-off-by: Fabio Baltieri --- drivers/clk/ux500/clk-sysctrl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/clk/ux500/clk-sysctrl.c b/drivers/clk/ux500/clk-sysctrl.c index bc7e9bd..e364c9d 100644 --- a/drivers/clk/ux500/clk-sysctrl.c +++ b/drivers/clk/ux500/clk-sysctrl.c @@ -145,7 +145,13 @@ static struct clk *clk_reg_sysctrl(struct device *dev, return ERR_PTR(-ENOMEM); } - for (i = 0; i < num_parents; i++) { + /* set main clock registers */ + clk->reg_sel[0] = reg_sel[0]; + clk->reg_bits[0] = reg_bits[0]; + clk->reg_mask[0] = reg_mask[0]; + + /* handle clocks with more than one parent */ + for (i = 1; i < num_parents; i++) { clk->reg_sel[i] = reg_sel[i]; clk->reg_bits[i] = reg_bits[i]; clk->reg_mask[i] = reg_mask[i];