From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4ADE3C001DF for ; Tue, 1 Aug 2023 12:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3GtusdfOjy8ZojtGVxl4o3ikjOtbp0rvI27bqYKXotc=; b=N5/k6OiVg5C1u3 cqLni/+A157hPbaExU2vBVXL6w1lie+89yalTazo1KTwMTHjWGByotwGCuWZvXNlmw8DXKrhpjeaT +Ym2aPm4HMcP8VXQGUfOSvhjPvtq1Bi+DIRpYVGYG21HfETxr5/Sg9OEbhux97SsIDFF/Je5Jnavv 1rqs13bzrYcGbpue29pyMheuyGaW/SiMdRqhOcHfzaawsuzDycJNaEErl5FZNbn9LimXuwXuO5Z0a w8Zf29AoXQMl0sqE7tlbyTRqmlLfT5JQBF6n2Ak4mtdcWrEflwyJwioRrfY3f/vSJ9RyqkaDELOV1 Y+bGF42+QTSvl5F5rA5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQoXH-002MDB-36; Tue, 01 Aug 2023 12:31:35 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQoPV-002JAd-0S for linux-arm-kernel@lists.infradead.org; Tue, 01 Aug 2023 12:23:36 +0000 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2b9bee2d320so85244891fa.1 for ; Tue, 01 Aug 2023 05:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20221208.gappssmtp.com; s=20221208; t=1690892609; x=1691497409; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3dKKb8ls1yAP3+3mMQaiILbL8e0BLGeeP71QwTnllps=; b=DkC0mBvOrKncTR0k7i72XDXDqoiXnY5ESHrTxvblfT+XNNur60TNYc0Eu8RO3om33H dyIhrfT/uhhl6ep/jzS4FuRLnjsNK4XunT+VmqruJLEKbscR9sAn6PbhEhM9Ugf8jwUB y46izYudAlIV4wvT/BChT8Xg6Cl2TMQoLaxj3IwocqY0Uj8XWtE+lmK1jnWrLnIqOMit VGhdwPJTHBa4TEWcfBZqUoyFlr+Uj38ZcFHCpEnGfrG3VI32dTQpl3/PwCEA1Fx/M707 dNPeHcGmcXMphSO4fiSpc9Z3/Rb7/nCyvqYJKYofitaY6MEtoHrAr/bsaighbpJh5u3T SymA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690892609; x=1691497409; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3dKKb8ls1yAP3+3mMQaiILbL8e0BLGeeP71QwTnllps=; b=JqigBbszR/CL0odJUQNPx9PJ1/i4QCQYeLzqPBlHd/poABMLA0FdYYqNjna3X/nqte 1XTCCWFdM2hBGRtSf+zjpSkKqjbHy3jK7CkB+nKpRum+a7RjnygX+GEJLJ+NRN7Z7olz HbR4TptXzWuJhxuIAFQD/RhDspGXhFTajR3KPHH24ntZD5yX//lyiB9AuIGYHIfjtqSN N/j1rMshEGhZSF3VVds49Bor3iEoySySQX+W7yuDo2sP3c1ctNeBUiBmDzj+LAA+szTX THond2izbSrSwLA3rBlwAV5JHfboa11mPLv1r9rclLz+q18MWqwmzInHaxaJTHqLG+yN kzpg== X-Gm-Message-State: ABy/qLbg5njORHbpY2dfCt3E8PnYvGcuLOepTmIEa2NYwZIrU0n1qtc8 EeXmAkOHPcF0LeT1jRISwG0cqw== X-Google-Smtp-Source: APBJJlF/3jq9D6dGWILWuPZqPWOO2eVUUSeT2OYvPtJDFMk/nXyWLvKlRdfiSnt1TvyeRIWwt+jppA== X-Received: by 2002:a2e:b0fb:0:b0:2b9:eb0f:c733 with SMTP id h27-20020a2eb0fb000000b002b9eb0fc733mr2426646ljl.35.1690892608710; Tue, 01 Aug 2023 05:23:28 -0700 (PDT) Received: from localhost ([212.23.236.67]) by smtp.gmail.com with ESMTPSA id si15-20020a170906cecf00b00993004239a4sm7585260ejb.215.2023.08.01.05.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 05:23:27 -0700 (PDT) Date: Tue, 1 Aug 2023 14:23:26 +0200 From: Jiri Pirko To: Vadim Fedorenko Cc: Jakub Kicinski , Arkadiusz Kubalewski , Jonathan Lemon , Paolo Abeni , Milena Olech , Michal Michalik , linux-arm-kernel@lists.infradead.org, poros@redhat.com, mschmidt@redhat.com, netdev@vger.kernel.org, linux-clk@vger.kernel.org, Bart Van Assche Subject: Re: [PATCH net-next 06/11] dpll: netlink: Add DPLL framework base functions Message-ID: References: <20230720091903.297066-1-vadim.fedorenko@linux.dev> <20230720091903.297066-7-vadim.fedorenko@linux.dev> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230720091903.297066-7-vadim.fedorenko@linux.dev> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_052333_420874_F878D482 X-CRM114-Status: UNSURE ( 8.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Thu, Jul 20, 2023 at 11:18:58AM CEST, vadim.fedorenko@linux.dev wrote: [...] >+ >+static int >+dpll_pin_parent_device_set(struct dpll_pin *pin, struct nlattr *parent_nest, >+ struct netlink_ext_ack *extack) >+{ >+ struct nlattr *tb[DPLL_A_MAX + 1]; >+ enum dpll_pin_direction direction; >+ enum dpll_pin_state state; >+ struct dpll_pin_ref *ref; >+ struct dpll_device *dpll; >+ u32 pdpll_idx, prio; >+ int ret; >+ >+ nla_parse_nested(tb, DPLL_A_MAX, parent_nest, >+ NULL, extack); Please pass proper policy instead of NULL here. dpll_pin_parent_device_nl_policy >+ if (!tb[DPLL_A_ID]) { >+ NL_SET_ERR_MSG(extack, "device parent id expected"); >+ return -EINVAL; >+ } >+ pdpll_idx = nla_get_u32(tb[DPLL_A_ID]); >+ dpll = xa_load(&dpll_device_xa, pdpll_idx); >+ if (!dpll) >+ return -EINVAL; >+ ref = xa_load(&pin->dpll_refs, dpll->device_idx); >+ ASSERT_NOT_NULL(ref); >+ if (tb[DPLL_A_PIN_STATE]) { >+ state = nla_get_u8(tb[DPLL_A_PIN_STATE]); >+ ret = dpll_pin_state_set(dpll, pin, state, extack); >+ if (ret) >+ return ret; >+ } >+ if (tb[DPLL_A_PIN_PRIO]) { >+ prio = nla_get_u8(tb[DPLL_A_PIN_PRIO]); >+ ret = dpll_pin_prio_set(dpll, pin, prio, extack); >+ if (ret) >+ return ret; >+ } >+ if (tb[DPLL_A_PIN_DIRECTION]) { >+ direction = nla_get_u8(tb[DPLL_A_PIN_DIRECTION]); >+ ret = dpll_pin_direction_set(pin, dpll, direction, extack); >+ if (ret) >+ return ret; >+ } >+ return 0; >+} >+ >+static int >+dpll_pin_parent_pin_set(struct dpll_pin *pin, struct nlattr *parent_nest, >+ struct netlink_ext_ack *extack) >+{ >+ struct nlattr *tb[DPLL_A_MAX + 1]; >+ enum dpll_pin_state state; >+ u32 ppin_idx; >+ int ret; >+ >+ nla_parse_nested(tb, DPLL_A_MAX, parent_nest, >+ NULL, extack); Please pass proper policy instead of NULL here. dpll_pin_parent_pin_nl_policy >+ if (!tb[DPLL_A_PIN_ID]) { >+ NL_SET_ERR_MSG(extack, "parent pin id expected"); >+ return -EINVAL; >+ } >+ ppin_idx = nla_get_u32(tb[DPLL_A_PIN_ID]); >+ state = nla_get_u8(tb[DPLL_A_PIN_STATE]); >+ ret = dpll_pin_on_pin_state_set(pin, ppin_idx, state, extack); >+ if (ret) >+ return ret; >+ >+ return 0; >+} [...] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel