Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2200240ybi; Sat, 25 May 2019 18:22:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGQOHTGh/lPuimrXeXkmEpLKghrMsDVmKsjH+GUE1xVKpzIOeTutjRO+UrLtwfPcjUBlt0 X-Received: by 2002:aa7:8219:: with SMTP id k25mr32615225pfi.38.1558833721628; Sat, 25 May 2019 18:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558833721; cv=none; d=google.com; s=arc-20160816; b=bCS7956JlB9mnBvkfbHB0igi8IS2rdsXyYSAt5Q6rRED1845WE/PGHMD2QaHawOGkf onDxHO9SjEWHLgoLc74Dkp2LDqIYZQMpRmMCts1pWw/Ok82HUqHcNTgfZs/j6eWZzrdV fUXGphQWoICqlDClorM6skmK1TFVS7xHUkm7hNlDxV+qezHRlSoS0ene71kzQs4beh8F X47ziEQeo/ftvr80mCi2eACXawdA0sdgJAlM5EDT6XgDkZLq90MXkPCMdBEIwK/AYWOU dsE2U64pBqaXJfIlhq/jXGyqs+85lHuvuYRCR901sAkFM4z6+wAbA8LjBy9APlmX0V6r KUKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=g9RckfaOyTf+xFTNPpwPEwsOHKNyfyEU38Mp+/sU6tA=; b=mVqLKl4HHzacv3Vwqzz9kTjCS5tdGuZw0EGy0cciUQdBKPPFfyIC4j8G5YH5nZjtej NkHIFLdtErKThnrnOMAOXtuwxggVaB8Y/STpkHao63S9npGJKkLY4F2k0Bd8EnrZl3uj eRldd6nLNBLMVPsb+qee3zSbh9HEPr5YVnN+nS/IoH/srlHGIGENBp33F+06EVDizEHE 5QlOVPDpOSkF5dFRoFe/lwns44zoT5Pr4R5Fq0VJWXsONNLwhGBcHPKG+lB533tOm9Q2 xppQD6AzfnXhhxCgmGOsO3ZrLf/3nNERLk7ZSOzeWcOthaTHL/psx/2J0LuBRU2BWncq lV8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Bl5RYhYl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id m191si11025696pga.17.2019.05.25.18.21.46; Sat, 25 May 2019 18:22:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Bl5RYhYl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727723AbfEZBTz (ORCPT + 99 others); Sat, 25 May 2019 21:19:55 -0400 Received: from mail-ua1-f66.google.com ([209.85.222.66]:44080 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727650AbfEZBTg (ORCPT ); Sat, 25 May 2019 21:19:36 -0400 Received: by mail-ua1-f66.google.com with SMTP id i48so4468785uae.11 for ; Sat, 25 May 2019 18:19:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g9RckfaOyTf+xFTNPpwPEwsOHKNyfyEU38Mp+/sU6tA=; b=Bl5RYhYlgHEhSe+fBzBodm5gri9kU46xOgubbeARfaOCNWwXx2s4plzGJ9QIB4bX6l Xl1WsEcrCWXFebX6rOjCpQWq68SQPGD8yd0eV7YrwrwRfthm+qqJ+0sEVCoCpDa5pSl3 Kl8FsX46jh2CycJjApTTqMSPPQ+X5ejSHE8XjjYGtDpKBOmGtim8wDGXZ0VxIZvZsSKP kzWmwcbvMmZv/iMHOmm3BDyWP77yvAMUra9onJSTNmj09wIZufJK7WU0xRTfYdpUhQVR q2x5ZfQfMM60zny5ZvtNqC/o1yyprl7Jmga07pmSK1ic/CmL1PIc+qtLMja849IJfj2D 8J5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g9RckfaOyTf+xFTNPpwPEwsOHKNyfyEU38Mp+/sU6tA=; b=lqYzIRw8VSJDtPN4DAAxirBMerdRMDMDgEBr2FrggMgw1RahP+oMOkj0QsfzTUuAgz N9Wgr7BY3ibyanFHicx+BrcIgW5UEuOpTHaY+kQgVxgxJI6ni0lpP0eERrjhindF64Xs dZ0/LmK+lPoV8wY8sG/xzmNbghujgU8nBYYzDbQnnlPPAP+E0//a9gAw/JryhQJGXDeo TQhOtydt3Ap48nRPgOxfur4O7gA/0TB78mVAWzHA5/HF6yxrAP60cHRSqio9ap+EMIHp 50l1w7tsv4BN2KXH5olH2FL0hVeHErQTP9s9KKLzFhIa/xkRuAUipwdEjDrWjrr9stwS Y62w== X-Gm-Message-State: APjAAAWIQ97wGkMD3Ife1JCOGfpWg/VIVLgsd04ZAI94wGaeqamCuFrr c5xTsTKvDriIix6BOZWvgS0= X-Received: by 2002:ab0:3499:: with SMTP id c25mr12364917uar.56.1558833575389; Sat, 25 May 2019 18:19:35 -0700 (PDT) Received: from arch-01.home (c-73-132-202-198.hsd1.md.comcast.net. [73.132.202.198]) by smtp.gmail.com with ESMTPSA id 9sm4593181vkk.43.2019.05.25.18.19.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 25 May 2019 18:19:34 -0700 (PDT) From: Geordan Neukum To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Geordan Neukum Subject: [PATCH 5/8] staging: kpc2000: kpc_i2c: Use drvdata instead of platform_data Date: Sun, 26 May 2019 01:18:31 +0000 Message-Id: X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The kpc_i2c driver stashes private state data in the platform_data member of its device structure. In general, the platform_data structure is used for passing data to the driver during probe() rather than as a storage area for runtime state data. Instead, use the drvdata member for all state info meant to be accessible in driver callbacks. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c index 1767f351a116..e4bbb91af972 100644 --- a/drivers/staging/kpc2000/kpc2000_i2c.c +++ b/drivers/staging/kpc2000/kpc2000_i2c.c @@ -589,7 +589,7 @@ static int pi2c_probe(struct platform_device *pldev) res = platform_get_resource(pldev, IORESOURCE_MEM, 0); priv->smba = (unsigned long)ioremap_nocache(res->start, resource_size(res)); - pldev->dev.platform_data = priv; + platform_set_drvdata(pldev, priv); priv->features |= FEATURE_IDF; priv->features |= FEATURE_I2C_BLOCK_READ; @@ -620,7 +620,7 @@ static int pi2c_remove(struct platform_device *pldev) { struct i2c_device *lddev; - lddev = (struct i2c_device *)pldev->dev.platform_data; + lddev = (struct i2c_device *)platform_get_drvdata(pldev); i2c_del_adapter(&lddev->adapter); -- 2.21.0