Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1223787pxa; Thu, 20 Aug 2020 06:07:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuV/35B5cjTH8QfsenhKYMeq9TejJLy8U63W72HNASze0MrB0Jlxy4e+XvuHK0CUC9iIaz X-Received: by 2002:a17:906:858:: with SMTP id f24mr3073886ejd.543.1597928843573; Thu, 20 Aug 2020 06:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597928843; cv=none; d=google.com; s=arc-20160816; b=mVTIGRB3/F1nGWIvck6czsPghQCKYQQFHTS9EIVI3cSHsqasI0ZVrOFQ6Vyu35m6o+ cxiAfhD1MJjNENNtEp8OarlEZdhQHL5oyMHpeAvlbbb5+B8zQG3lrd8uTvx8tP4WW382 uWpz+gj0mqN9kLMjzV4TN18cU4KAkfLqs2l6OXEN2Hdw/uZS+OHIWgX+KaRQPxGbGlzx ikNH63c6+XkW4mnorHwrm4/pCABlLpP/Zi0uwAiMG5wWHJ7RGWT3zQeSTB7FqqTZH46o cawNjh8mLN5bIJS9FUishAFvAijREO1Lpr4bz2/3IherQ9Ldec9Z4Y2jk+uF02S5guzu UGiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=diWOF1th57LrHj7EG5tnoK7CBPOeUfDwxvRZ4lqQiP0=; b=LMxd2ivMKQ+KEbBk28E9oLkEjzfjBtsfxRDc8a+7DvwTj1lE2DLGJOsNgamsUVZPAy Y4z6m7WOrcY6+8hBxncwsok7/n6oanNukCcUMrD2d3J1qmfuS6P+cfqhPpoPu1heVCaC M/jMBYTOnkk+KCA6VbxAvSgbH7oM1pviQSN94naWt7N1vfPdyMkgttP/P3LYxFQxNGFN DpxXW1/NlaraMTAONuItR1IW6+75RArr83h0DYDP/N1oxjWvHhl6dpYUecpESSpTnJSm ZTB5JBJXEWECwLmh5aCF4HbTqs/h52sMZqU1npe9WcX70HzrkotosQjon/+lFhexUi8e pJCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DeUdFykn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b31si1329005edf.456.2020.08.20.06.06.56; Thu, 20 Aug 2020 06:07:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DeUdFykn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729040AbgHTNGI (ORCPT + 99 others); Thu, 20 Aug 2020 09:06:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728871AbgHTNGB (ORCPT ); Thu, 20 Aug 2020 09:06:01 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59459C061385; Thu, 20 Aug 2020 06:06:01 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id g15so1008628plj.6; Thu, 20 Aug 2020 06:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=diWOF1th57LrHj7EG5tnoK7CBPOeUfDwxvRZ4lqQiP0=; b=DeUdFyknlpSmv5kkr6H1ATJsndaWr8MvMFne3KWTmGJG2YERGgiOrFBxV8km9lA2JU Oa6V7i+KP6qIv/FWA1Np283lXNOL3vRdGSIfwsFfjMhZKMY0/wcj28w6WCZAlYqMricd Be3+/O982WCiUXb4tsZAS9OEr/KdI9lmibNYy3XMw9HIowe2Rcv/4LpCoaBXo9dP8yXh CRznHv/OOUqYi5+iTNJzawAu6SO/kUXt4h3YBtZjIChyxiaFt77BG+zh/9lOdN6NSMog sVhkkOprbhTKlcnllopmB/AHS/eMfTPZmxPZ3XGQs2b2kqpFwjs1pyjTdZrCAtPc062G wvig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=diWOF1th57LrHj7EG5tnoK7CBPOeUfDwxvRZ4lqQiP0=; b=e//lRh9AMYuQTZVwCmflB4EyxTOOHT/7Onqa91elCj610CNrtA3bod7IeRBtwSDEGF sHNq9qpd4SLqvsfppmieYjXA8Db2tVoKnD3r7OyODmFLU6QqMcbuxorlMiUCQ4L7rIFH bHfGQ/56RrDfVAemhXD+iDNFvL+WJprfrYXIOeZfydVzrBPZt0fpREqsfoSjxHpmFms0 9w6Cci7qAQ51+QvuFXFTErR85EO8XupODV7Pk+5Q2hoqeZWyX3sD7ZboeyRUfXjzMQnG M+gnQxmAfmkL8lG4iRKyj/sUOZVOHQb1VZbKyX4vs9T9ZeWyxYBtUR0ErPzCiBRMAi1u 87/A== X-Gm-Message-State: AOAM533griJg3l0fI7SoYTGrwcsvbhPzBQp6HZK/av8Huz8A/nCUgS+l Z83WmxuqKqZHM1ifYxkQFVuijs31fV5ktcDoTNg= X-Received: by 2002:a17:90a:bc41:: with SMTP id t1mr2333932pjv.181.1597928760579; Thu, 20 Aug 2020 06:06:00 -0700 (PDT) MIME-Version: 1.0 References: <1597892486-3236-1-git-send-email-tiantao6@hisilicon.com> In-Reply-To: From: Andy Shevchenko Date: Thu, 20 Aug 2020 16:05:44 +0300 Message-ID: Subject: Re: [PATCH] iio: adc: adi-axi-adc: Use kobj_to_dev() instead of container_of() To: Alexandru Ardelean Cc: Tian Tao , Lars-Peter Clausen , "Hennerich, Michael" , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , linux-iio , LKML , Alexandru Ardelean Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 20, 2020 at 12:10 PM Alexandru Ardelean wrote: > On Thu, Aug 20, 2020 at 6:04 AM Tian Tao wrote: > > > > Use kobj_to_dev() instead of container_of() > Good point. > > Acked-by: Alexandru Ardelean ... > > - struct device *dev = container_of(kobj, struct device, kobj); > > + struct device *dev = kobj_to_dev(kobj); > > struct iio_dev *indio_dev = dev_to_iio_dev(dev); And now this can be one line since dev is not used separately. > > struct adi_axi_adc_state *st = iio_priv(indio_dev); > > struct adi_axi_adc_conv *conv = &st->client->conv; -- With Best Regards, Andy Shevchenko