Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1093925pxa; Thu, 20 Aug 2020 02:13:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1z0WFcrh4AbLXQ77eKnYbWnVXXVI7GWBV04J+jRyVPy18Es9BhVDGMxDFsjvG24CkVRkS X-Received: by 2002:a17:907:104a:: with SMTP id oy10mr2294751ejb.267.1597914784502; Thu, 20 Aug 2020 02:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597914784; cv=none; d=google.com; s=arc-20160816; b=P/tKZ3LGHoywYyU2qoC1WE7kWzOo1uPLrekUFAuqMfXhk2TOBTj8k7krOa3KrMTLbl L9MuNlOPDnTt59Yf7jPUQMK6lLZnbryI1kCkGUD4+hyRcFXq3Rrhb1PfGPNRNt/2dpy8 mgMvkHspdph9/n/Cbp9UAvM9rp309YEJbr8R3ut57gETcJz2IwVXLwDem6iTW5uiHWmQ +Nc5hvI3Uf9NU4Abuby5qe9NYw5ugjwPLt374+fkl6YMnD32BGK0kwj5drKPdxoYJDxN fmzHGWdyK6IntUf7u7KPTnt7ykboqhR7dLLhmV+ZhV2l/X4OrjfNvoZa/Y9ByAZZK9Id 6T1A== 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=zjr2E15Ms5YFsENJJqQ70oL/KScY+TpK+MfdOTOoPY4=; b=os6YPSdBzaNphTfDufS9nwBh1LcaeVriGp7dPiLtARyekJ/d1BgazUj99/7s6aSmB0 XyD1a1Aq8klTsCiE7VLD2ceq1ymaQLwRsUgWDmbLDdPsR4ocsAVjonBKepe3hxm05WRY R3/rXmECU1sEEYR6YgAYCWYDx/+I1oceXFsBIXaiaPYnpvvt8RVX1y+U1zWQcB/0Jabg 9kggax5AuwmmnYQxquLgCHvuI3PhpHaBoZ0wSTdzeBVswaCZdQkEgDtuPM7lS9aUPoIj OIF0rvs/gWO/vc/fLDw2SqdY6wARLvSwAOOZK4SDIHGkhyvCz8V/wfePJWQpwLODYlOP +YYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mG5DtB5V; 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 bq8si349775ejb.670.2020.08.20.02.12.40; Thu, 20 Aug 2020 02:13:04 -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=mG5DtB5V; 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 S1725916AbgHTJJ5 (ORCPT + 99 others); Thu, 20 Aug 2020 05:09:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbgHTJJx (ORCPT ); Thu, 20 Aug 2020 05:09:53 -0400 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C62A2C061757; Thu, 20 Aug 2020 02:09:53 -0700 (PDT) Received: by mail-ot1-x341.google.com with SMTP id t7so915211otp.0; Thu, 20 Aug 2020 02:09:53 -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=zjr2E15Ms5YFsENJJqQ70oL/KScY+TpK+MfdOTOoPY4=; b=mG5DtB5VoZ69zbFyObb+lBGIOAtPQJfVdBuxVsWh0TD8yc+lbXZWMmDz+xb7CKtePN rbxBMwydUHGAO6Sx5kQpsWYue/HVrNRDOiy/+F5OlL0VjH7MurSFZOTantPl6et68bqz R22Y/StsrlhU4P5t2osilRnGzyb6S09DzGvad55/vwiym2gPvbgXNaKAAAJYDQl4e/Ea /hCtpZlJ4MrQX5/WP4rOx3szsPxQW/kyUqq1AIvq8H61F0xj0xek8XKFWclR85YKqhWI wsjyyum2VdSKcWP2oi+5lGe/1ysGKerP77iMGwiMC1BxXyswAwR2/cP5JKRtGj1rnsjr NVWA== 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=zjr2E15Ms5YFsENJJqQ70oL/KScY+TpK+MfdOTOoPY4=; b=oRDM8VNycjEf3E+qXpYBF367DBLF5EajBN4AHoGoVapVFddgDULsMeak2naoTB9svX y8yS4gNr/y75ShlWI6p0CNfr3UGcZvqEdYaNV74n1/QhZhzO0pm8et39TjG/pg8Qu5Xr Ul7vInZKv5UNiTImpgQDJ3i2LGdNy/KvNTm0wXU4QrN3nC4bO6tSofr7tfe/XLBG09O/ AXCbgLjfTinRA69zSQck3mDhGOuvQnKcMR5O9mdLLUq5dUC4qGsqgdQafFQuZUO8oLof ajr9Rg9jt1SL27wldJ/UfB4tT1Kj6Bxu7CdBoMXFJbO4iy1uOLHoo01RWIu84IhYOyMO vj7A== X-Gm-Message-State: AOAM532oKRt6EQTCIVbddHwmypFP4Zfp5WOAoK9ITwse+aVUYREugctR zcM5PDWT5mplsRscBFP4OtIl2zTzZHLnG153WzY= X-Received: by 2002:a9d:f2a:: with SMTP id 39mr1511600ott.119.1597914593196; Thu, 20 Aug 2020 02:09:53 -0700 (PDT) MIME-Version: 1.0 References: <1597892486-3236-1-git-send-email-tiantao6@hisilicon.com> In-Reply-To: <1597892486-3236-1-git-send-email-tiantao6@hisilicon.com> From: Alexandru Ardelean Date: Thu, 20 Aug 2020 12:09:42 +0300 Message-ID: Subject: Re: [PATCH] iio: adc: adi-axi-adc: Use kobj_to_dev() instead of container_of() To: Tian Tao Cc: 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 6:04 AM Tian Tao wrote: > > Use kobj_to_dev() instead of container_of() > Good point. Acked-by: Alexandru Ardelean > Signed-off-by: Tian Tao > --- > drivers/iio/adc/adi-axi-adc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c > index 86b6b65..9109da2 100644 > --- a/drivers/iio/adc/adi-axi-adc.c > +++ b/drivers/iio/adc/adi-axi-adc.c > @@ -276,7 +276,7 @@ static struct attribute *adi_axi_adc_attributes[] = { > static umode_t axi_adc_attr_is_visible(struct kobject *kobj, > struct attribute *attr, int n) > { > - 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); > struct adi_axi_adc_state *st = iio_priv(indio_dev); > struct adi_axi_adc_conv *conv = &st->client->conv; > -- > 2.7.4 >