aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-06-04 04:50:02 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-05 00:21:29 -0400
commite4e8b7765867e8f4705bcc18b8930edbe0e4ef3c (patch)
treed908c7a41b1b0f6917007eb4e4621a041905301a /include
parent44dd5b02530a5aaea16c1a0a9eea377407445b4a (diff)
iio: Add iio_device_get()
This patch add the iio_device_get() function, which increases the reference count of a iio device. The matching function to decrease the reference count - iio_device_put() - already exists. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/iio/iio.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 3a4f6a3ab80d..3238fa3374f7 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -438,6 +438,17 @@ static inline struct iio_dev *dev_to_iio_dev(struct device *dev)
438 return container_of(dev, struct iio_dev, dev); 438 return container_of(dev, struct iio_dev, dev);
439} 439}
440 440
441/**
442 * iio_device_get() - increment reference count for the device
443 * @indio_dev: IIO device structure
444 *
445 * Returns: The passed IIO device
446 **/
447static inline struct iio_dev *iio_device_get(struct iio_dev *indio_dev)
448{
449 return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL;
450}
451
441/* Can we make this smaller? */ 452/* Can we make this smaller? */
442#define IIO_ALIGN L1_CACHE_BYTES 453#define IIO_ALIGN L1_CACHE_BYTES
443/** 454/**
a> 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528















































































































































































































































































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
%PDF-1.4
%쏢
5 0 obj
<</Length 6 0 R/Filter /FlateDecode>>
stream
xl]Jn^LKwoppZc
3=?_>?]mu
_?Z]{+??c
5$bkk>%V_5u֪W]Jb5<Z }U׏Di{?qnDl~-'b=]

"VWIjc
e9(ZAԲduQ˒Qr"~
e/ jX%A%VߨrAĚ)w`ߔw βlUQ"wW,S-'sտ^{,D,ރI^]IԲl&^JceRej9QkrDf`_/rAIJze3r 3ʃ#]Vʐ;0Zo= bY!w`D-ŐUށIԲ\.ZyKcD,^},ˉXV-e
"UKPԱlq^\yR{&Qk{D,+i3I"Պ_+ZoI&j`ZA^WVZ+ZD-F/ȯUVꓨeXNIJZ)XAԲ|"V-D